Export (0) Print
Expand All

SpriteBatch.Begin Method (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).

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

public void Begin (
         SpriteSortMode sortMode,
         BlendState blendState,
         SamplerState samplerState,
         DepthStencilState depthStencilState,
         RasterizerState rasterizerState
)

Parameters

sortMode
Type: SpriteSortMode
Sprite drawing order.
blendState
Type: BlendState
Blending options.
samplerState
Type: SamplerState
Texture sampling options.
depthStencilState
Type: DepthStencilState
Depth and stencil options.
rasterizerState
Type: RasterizerState
Rasterization 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.

Xbox 360, Windows 7, Windows Vista, Windows XP

Community Additions

ADD
Show:
© 2014 Microsoft