Microsoft.Xna.Framework.Graphics.SpriteBatch.End C# (CSharp) Method

End() public method

Flushes all batched text and sprites to the screen.
This command should be called after Begin and drawing commands.
public End ( ) : void
return void
		public void End ()
		{	
			_beginCalled = false;

			if (_sortMode != SpriteSortMode.Immediate)
				Setup();
            
            _batcher.DrawBatch(_sortMode, _effect);
        }
		

Usage Example

Example #1
5
 public override void ReflectionRender(SpriteBatch spriteBatch)
 {
     if (this.txTexture == RenderMaster.txNullTex)
     {
         return;
     }
     this.txToUse = this.txTexture;
     if (this.dentxAlternateTextures.ContainsKey(RenderMaster.enCurrentPass))
     {
         this.txToUse = this.dentxAlternateTextures[RenderMaster.enCurrentPass];
     }
     if (base.xEffectWrapper == null)
     {
         spriteBatch.Draw(this.txToUse, Utility.Vector2_ToInts(this.xTransform.v2Pos - this.v2OffsetRenderPos) - Utility.Vector2_ToInts(this.xCamera.v2TopLeft * this.v2ParallaxFactor), null, this.cColor * this.fAlpha, this.fRotation, new Vector2(this.v2Offset.X, (float)this.txTexture.Height - this.v2Offset.Y), this.v2Scale, this.enSpriteEffect | SpriteEffects.FlipVertically, 0f);
         return;
     }
     spriteBatch.End();
     foreach (KeyValuePair<string, float> kvp in this.dsfFloatShaderParameters)
     {
         base.xEffectWrapper.xEffect.Parameters[kvp.Key].SetValue(kvp.Value);
     }
     spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null, base.xEffectWrapper.xEffect);
     spriteBatch.Draw(this.txToUse, Utility.Vector2_ToInts(this.xTransform.v2Pos - this.v2OffsetRenderPos) - Utility.Vector2_ToInts(this.xCamera.v2TopLeft * this.v2ParallaxFactor), null, this.cColor * this.fAlpha, this.fRotation, new Vector2(this.v2Offset.X, (float)this.txTexture.Height - this.v2Offset.Y), this.v2Scale, this.enSpriteEffect | SpriteEffects.FlipVertically, 0f);
     spriteBatch.End();
     spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null);
 }
All Usage Examples Of Microsoft.Xna.Framework.Graphics.SpriteBatch::End