Gonzo.Elements.UILabel.Draw C# (CSharp) Method

Draw() public method

public Draw ( SpriteBatch SBatch, float LayerDepth ) : void
SBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
LayerDepth float
return void
        public override void Draw(SpriteBatch SBatch, float? LayerDepth)
        {
            float Depth;
            if (LayerDepth != null)
                Depth = (float)LayerDepth;
            else
                Depth = 1.0f;

            if (Caption != "")
            {
                if (Visible)
                {
                    SBatch.DrawString(m_Font, Caption, Position, m_TextColor, 0.0f, new Vector2(0.0f, 0.0f), 1.0f,
                        SpriteEffects.None, Depth);
                }
            }
        }

Usage Example

コード例 #1
0
        public override void Draw(SpriteBatch SBatch, float?LayerDepth)
        {
            float Depth;

            if (LayerDepth != null)
            {
                Depth = (float)LayerDepth;
            }
            else
            {
                Depth = 0.9f; //Progressbars are always drawn on top
            }
            //Texture is 45px / 3 = 15px wide
            m_ProgressBarBack.Draw(SBatch, new Rectangle((int)Position.X, (int)Position.Y, 15, (int)m_Size.Y),
                                   new Rectangle(0, 0, 15, (int)m_Size.Y), Depth + 0.1f);

            m_ProgressBarBack.Draw(SBatch, new Rectangle((int)(Position.X + 15), (int)Position.Y, (int)(Size.X - 30),
                                                         (int)m_Size.Y), new Rectangle(15, 0, 15, (int)m_Size.Y), Depth + 0.1f);

            m_ProgressBarBack.Draw(SBatch, new Rectangle((int)((Position.X + Size.X) - 15), (int)Position.Y, 15,
                                                         (int)m_Size.Y), new Rectangle(30, 0, 15, (int)m_Size.Y), Depth + 0.1f);

            m_LblCurrentStatus.Draw(SBatch, LayerDepth + 0.3f);

            base.Draw(SBatch, LayerDepth);
        }
All Usage Examples Of Gonzo.Elements.UILabel::Draw