Пример #1
0
        public Menu()
        {
            _spriteBatch = new SpriteBatch(ToylandSiege.GetInstance().GraphicsDevice);

            var btn1Texture = new Texture2D(ToylandSiege.GetInstance().GraphicsDevice, btnWidth, btnHeight);
            var btn2Texture = new Texture2D(ToylandSiege.GetInstance().GraphicsDevice, btnWidth, btnHeight);
            var btn3Texture = new Texture2D(ToylandSiege.GetInstance().GraphicsDevice, btnWidth, btnHeight);

            btn1Texture.SetData(CreateTexture(Color.Aqua));
            btn2Texture.SetData(CreateTexture(Color.White));
            btn3Texture.SetData(CreateTexture(Color.Red));

            btn1 = new Menubutton(btn1Texture, (ToylandSiege.GetInstance().GraphicsDevice.DisplayMode.Width / 2) - (btnWidth / 2), 150, btnWidth, btnHeight, "Start Tutorial");
            btn2 = new Menubutton(btn2Texture, (ToylandSiege.GetInstance().GraphicsDevice.DisplayMode.Width / 2) - (btnWidth / 2), 300, btnWidth, btnHeight, "Start Level 1");
            btn3 = new Menubutton(btn3Texture, (ToylandSiege.GetInstance().GraphicsDevice.DisplayMode.Width / 2) - (btnWidth / 2), 450, btnWidth, btnHeight, "Exit");
        }
Пример #2
0
        public Strategic()
        {
            soldierTexture2D = ToylandSiege.GetInstance().Content.Load <Texture2D>("soldierTexture");
            scoutTexture2D   = ToylandSiege.GetInstance().Content.Load <Texture2D>("scoutTexture");
            tankTexture2D    = ToylandSiege.GetInstance().Content.Load <Texture2D>("TankTexture");
            _spriteBatch     = new SpriteBatch(ToylandSiege.GetInstance().GraphicsDevice);

            //Create start Wave button
            var startWaveTexture = new Texture2D(ToylandSiege.GetInstance().GraphicsDevice, btnWidth, btnHeight);
            var data             = new Color[btnWidth * btnHeight];

            for (int i = 0; i < data.Length; ++i)
            {
                data[i] = Color.Green;
            }
            startWaveTexture.SetData(data);
            StartWaveBtn = new Menubutton(startWaveTexture, (ToylandSiege.GetInstance().GraphicsDevice.DisplayMode.Width / 2) - (btnWidth / 2), ToylandSiege.GetInstance().GraphicsDevice.DisplayMode.Height - 70, btnWidth, btnHeight, "Start Wave   ");
        }