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);
}
}
}