Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Begin Method (SpriteBlendMode, SpriteSortMode, SaveStateMode)

SpriteBatch.Begin Method (SpriteBlendMode, SpriteSortMode, SaveStateMode)

Prepares the graphics device for drawing sprites with specified blending, sorting, and render state options.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public void Begin (
         SpriteBlendMode blendMode,
         SpriteSortMode sortMode,
         SaveStateMode stateMode
)

Parameters

blendMode
Blending options to use when rendering.
sortMode
Sorting options to use when rendering.
stateMode
Rendering state options.

Exception typeCondition
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.

This method must be called before any calls to Draw. When all the sprites have been drawn, call End.

Begin sets the following render states:

Begin sets the following sampler states:

If Begin is called with SaveStateMode set to None, the caller must reset these states must be reset if they are used elsewhere. Calling Begin with SaveStateMode set to SaveState will reset these values properly, but performance may be adversely affected.

Xbox 360, Windows XP SP2, Windows Vista

Community Additions

ADD
Show:
© 2015 Microsoft