Ejemplo n.º 1
0
        /// <summary>
        /// Begins a new sprite batch using the appropriate settings for rendering UPF.
        /// </summary>
        /// <param name="sortMode">The sorting mode to use when rendering interface elements.</param>
        /// <param name="blendState">The blend state to apply to the rendered elements.</param>
        /// <param name="samplerState">The sampler state to apply to the rendered interface elements.</param>
        /// <param name="effect">The custom effect to apply to the rendered interface elements.</param>
        /// <param name="localTransform">The transform matrix to apply to the rendered interface elements.</param>
        public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, Effect effect, Matrix localTransform)
        {
            if (SpriteBatch == null)
                throw new InvalidOperationException(PresentationStrings.DrawingContextDoesNotHaveSpriteBatch);

            this.localTransform = localTransform;
            this.combinedTransform = Matrix.Identity;
            Matrix.Concat(ref localTransform, ref globalTransform, out combinedTransform);

            SpriteBatch.Begin(sortMode, 
                blendState ?? BlendState.AlphaBlend,
                samplerState ?? SamplerState.LinearClamp, 
                StencilReadDepthState, RasterizerState.CullCounterClockwise, effect, combinedTransform);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Begins a new sprite batch using the appropriate settings for rendering UPF.
 /// </summary>
 /// <param name="sortMode">The sorting mode to use when rendering interface elements.</param>
 /// <param name="effect">The custom effect to apply to the rendered interface elements.</param>
 /// <param name="localTransform">The transform matrix to apply to the rendered interface elements.</param>
 public void Begin(SpriteSortMode sortMode, Effect effect, Matrix localTransform)
 {
     Begin(sortMode, null, null, effect, localTransform);
 }