Example #1
0
        public InGameUI(Texture2D[] listOfTexture, ref List <Cell> cellWithTower)
        {
            sB             = new StringBuilder();
            cellsWithTower = cellWithTower;
            textures       = listOfTexture;
            textBounds     = new Rectangle[textures.Length];
            textBounds[0]  = new Rectangle(0, GraphicsDeviceManager.DefaultBackBufferHeight - (textures[0].Height + 2), textures[0].Width, textures[0].Height + 2);
            buttonList     = new List <UIButtons>();
            allButtons     = new List <UIButtons>();

            UIButtons add = new UIButtons();

            add.icon        = listOfTexture[2];
            add.Hotkey      = Keys.A;
            add.couleur     = Color.White;
            add.returnState = InGameState.Add;
            add.function    = UIButtonFunction.Add;
            add.spacePos    = new Rectangle(15, 375, 40, 40);
            add.Clic       += add_Clic;
            allButtons.Add(add);

            UIButtons upgrade = new UIButtons();

            upgrade.icon        = listOfTexture[3];
            upgrade.Hotkey      = Keys.U;
            upgrade.couleur     = Color.White;
            upgrade.returnState = InGameState.Play;
            upgrade.function    = UIButtonFunction.Upgrade;
            upgrade.spacePos    = new Rectangle(15, 425, 40, 40);
            upgrade.Clic       += upgrade_Clic;
            allButtons.Add(upgrade);

            UIButtons sell = new UIButtons();

            sell.icon        = listOfTexture[1];
            sell.Hotkey      = Keys.S;
            sell.couleur     = Color.White;
            sell.spacePos    = new Rectangle(65, 425, 40, 40);
            sell.returnState = InGameState.Play;
            sell.function    = UIButtonFunction.Sell;
            sell.doAnimation = false;
            sell.Clic       += sell_Clic;
            allButtons.Add(sell);
            SetButtons();
            infoPos = new Vector2(135, 375);
        }
Example #2
0
        public InGameUI(Texture2D[] listOfTexture, ref List<Cell> cellWithTower)
        {
            sB = new StringBuilder();
            cellsWithTower = cellWithTower;
            textures = listOfTexture;
            textBounds = new Rectangle[textures.Length];
            textBounds[0] = new Rectangle(0, GraphicsDeviceManager.DefaultBackBufferHeight - (textures[0].Height + 2), textures[0].Width, textures[0].Height + 2);
            buttonList = new List<UIButtons>();
            allButtons = new List<UIButtons>();

            UIButtons add = new UIButtons();
            add.icon = listOfTexture[2];
            add.Hotkey = Keys.A;
            add.couleur = Color.White;
            add.returnState = InGameState.Add;
            add.function = UIButtonFunction.Add;
            add.spacePos = new Rectangle(15, 375, 40, 40);
            add.Clic += add_Clic;
            allButtons.Add(add);

            UIButtons upgrade = new UIButtons();
            upgrade.icon = listOfTexture[3];
            upgrade.Hotkey = Keys.U;
            upgrade.couleur = Color.White;
            upgrade.returnState = InGameState.Play;
            upgrade.function = UIButtonFunction.Upgrade;
            upgrade.spacePos = new Rectangle(15, 425, 40, 40);
            upgrade.Clic += upgrade_Clic;
            allButtons.Add(upgrade);

            UIButtons sell = new UIButtons();
            sell.icon = listOfTexture[1];
            sell.Hotkey = Keys.S;
            sell.couleur = Color.White;
            sell.spacePos = new Rectangle(65, 425, 40, 40);
            sell.returnState = InGameState.Play;
            sell.function = UIButtonFunction.Sell;
            sell.doAnimation = false;
            sell.Clic += sell_Clic;
            allButtons.Add(sell);
            SetButtons();
            infoPos = new Vector2(135, 375);
        }