/// <summary> /// Initializes a new instance of the <see cref="Client.Common.Views.HUD.PopulationResource"/> class. /// </summary> /// <param name="fileName">PNG file name.</param> /// <param name="color">Fill color.</param> public PopulationResource(string fileName, CCColor3B color) : base() { m_background = new Button( fileName, fileName, OnTouched); AddChild(m_background); m_background.Sprite.Opacity = 100; // picture source // <div>Icons made by <a href="http://www.freepik.com" title="Freepik">Freepik</a> // from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> // is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" // title="Creative Commons BY 3.0">CC BY 3.0</a></div> m_progress = new CCProgressTimer(fileName); m_progress.Color = color; m_progress.Type = CCProgressTimerType.Bar; m_progress.BarChangeRate = new CCPoint(0.0f, 1.0f); m_progress.Midpoint = new CCPoint(0.0f, 0.0f); m_progress.PositionX = m_background.AnchorPoint.X; m_progress.PositionY = m_background.AnchorPoint.Y; m_background.AddChild(m_progress); Schedule(ShowRessource); }