BlisterUI.Widgets.WidgetRenderer.Draw C# (CSharp) Method

Draw() public method

public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
return void
        public void Draw(SpriteBatch batch)
        {
            batch.Begin(SpriteSortMode.BackToFront, BlendState.NonPremultiplied, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullNone);
            for(int i = 0; i < rects.Count; i++) {
                // Draw Rectangle
                batch.Draw(
                    rects[i].texture == null ? tPixel : rects[i].texture,
                    rects[i].location,
                    null,
                    rects[i].color,
                    0f,
                    Vector2.Zero,
                    SpriteEffects.None,
                    rects[i].layerDepth
                    );
            }
            for(int i = 0; i < texts.Count; i++) {
                // Draw Text
                if(texts[i].Font == null)
                    texts[i].Font = fDefault;
                batch.DrawString(
                    texts[i].Font,
                    texts[i].Text,
                    texts[i].location,
                    texts[i].color,
                    0f,
                    Vector2.Zero,
                    texts[i].TextScale,
                    SpriteEffects.None,
                    texts[i].layerDepth
                    );
            }
            batch.End();
        }