/// <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); }
/// <summary> /// Initializes a new instance of the <see cref="Client.Common.Views.HUD.HUDLayer"/> class. /// </summary> /// <param name="gameScene">Game scene.</param> public HUDLayer(GameScene gameScene) : base() { m_gameScene = gameScene; m_gps = new Button( "radars2-standard", "radars2-touched", new Action(BackToGPS)); m_gps.AnchorPoint = CCPoint.AnchorLowerLeft; AddChild(m_gps); m_debug = new Button( "debug-standard", "debug-touched", new Action(StartDebug)); m_debug.AnchorPoint = CCPoint.AnchorLowerLeft; AddChild(m_debug); m_energyRessource = new EnergyResource(); m_energyRessource.AnchorPoint = CCPoint.AnchorUpperLeft; AddChild(m_energyRessource); m_scrapResource = new ScrapResource(Constants.ClientConstants.SCRAP, CCColor3B.Orange); m_scrapResource.AnchorPoint = CCPoint.AnchorUpperLeft; AddChild(m_scrapResource); m_plutoniumResource = new PlutoniumResource(Constants.ClientConstants.PLUTONIUM, CCColor3B.Green); m_plutoniumResource.AnchorPoint = CCPoint.AnchorUpperLeft; AddChild(m_plutoniumResource); m_populationResource = new PopulationResource(Constants.ClientConstants.POPULATION, CCColor3B.White); m_populationResource.AnchorPoint = CCPoint.AnchorUpperLeft; AddChild(m_populationResource); m_techologyResource = new TechnologyResource(Constants.ClientConstants.TECHNOLOGY, CCColor3B.Blue); m_techologyResource.AnchorPoint = CCPoint.AnchorUpperLeft; AddChild(m_techologyResource); m_question = new Button( "question-standard", "question-touched", new Action(DeveloperFunction)); m_question.AnchorPoint = CCPoint.AnchorLowerLeft; AddChild(m_question); m_question.Visible = false; }
/// <summary> /// Initializes a new instance of the <see cref="Client.Common.Views.HUD.EnergyResource"/> class. /// </summary> public EnergyResource() : base() { m_background = new Button( Constants.HUD.Energy.DISPLAY, Constants.HUD.Energy.DISPLAY, OnTouched); m_pointer = new CCSprite(Common.Constants.HUD.Energy.POINTER); AddChild(m_background); AddChild(m_pointer); var energy = GameAppDelegate.Account.Energy; Schedule(ShowRessource); energy.Value = 0.0; m_lastValue = 0.0; }