Gonzo.Elements.UIButton.Draw C# (CSharp) Метод

Draw() публичный Метод

public Draw ( SpriteBatch SBatch, float LayerDepth ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
LayerDepth float
Результат void
        public override void Draw(SpriteBatch SBatch, float? LayerDepth)
        {
            if (Visible)
            {
                float Depth;
                if (LayerDepth != null)
                    Depth = (float)LayerDepth;
                else
                    Depth = 0.9f; //Buttons are always drawn on top.

                if (Image != null && Image.Loaded)
                {
                    Image.Draw(SBatch, new Rectangle((int)m_SourcePosition.X,
                        (int)m_SourcePosition.Y, (int)m_Size.X, (int)m_Size.Y),
                        Depth, new Vector2(m_XScale, 1.0f));
                }

                if (m_IsTextButton)
                {
                    SBatch.DrawString(m_Font, m_Text, m_TextPosition, TextDrawingColor, 0.0f,
                        new Vector2(0.0f, 0.0f), 1.0f, SpriteEffects.None, Depth + 0.1f);
                }
            }
        }

Usage Example

Пример #1
0
        public override void Draw(SpriteBatch SBatch, float?LayerDepth)
        {
            m_SkinBrowserArrowLeft.Draw(SBatch, m_Depth);
            m_SkinBrowserArrowRight.Draw(SBatch, m_Depth);

            base.Draw(SBatch, LayerDepth);
        }