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); }
public override void Draw(SpriteBatch SBatch, float?LayerDepth) { SBatch.Draw(m_ProgressBarBack, new Rectangle((int)Position.X, (int)Position.Y, (int)m_Size.X, (int)m_Size.Y), Color.White); if (m_ProgressInPercentage > 0) { SBatch.Draw(m_ProgressBarFront, new Rectangle((int)Position.X, (int)Position.Y, (int)m_Size.X, (int)(m_ProgressInPercentage / 100) * TotalProgressInPercentage), Color.White); } m_LblProgressInPercentage.Draw(SBatch, LayerDepth); base.Draw(SBatch, LayerDepth); }