Beispiel #1
0
        private void CreateBlockTab()
        {
            int tabIndex = 0;
            Texture2D texture;
            Texture2D texture2;
            Texture2D texture3;
            texture = mContentManager.Load<Texture2D>("textures\\UI\\box4_switched_on");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\box4_switched_off");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\box4_active");
            Switcher block = new Switcher(mSpriteBatch, texture, texture2, texture3);
            block.Position = new Vector2(10, 390);
            block.Click += BoxButton_Click;
            block.IsSwitchedOn = true;
            mControls.Add(block);
            mButtonsPerTab[tabIndex].Add(block);

            texture = mContentManager.Load<Texture2D>("textures\\UI\\box3_switched_on");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\box3_switched_off");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\box3_active");
            block = new Switcher(mSpriteBatch, texture, texture2, texture3);
            block.Position = new Vector2(95, 390);
            block.Click += BoxButton_Click;
            mControls.Add(block);
            mButtonsPerTab[tabIndex].Add(block);

            texture = mContentManager.Load<Texture2D>("textures\\UI\\box2_switched_on");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\box2_switched_off");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\box2_active");
            block = new Switcher(mSpriteBatch, texture, texture2, texture3);
            block.Position = new Vector2(180, 390);
            block.Click += BoxButton_Click;
            mControls.Add(block);
            mButtonsPerTab[tabIndex].Add(block);
        }
Beispiel #2
0
        private void CreateTabs()
        {
            Texture2D texture;
            Texture2D texture2, texture3;

            texture = mContentManager.Load<Texture2D>("textures\\UI\\building_switched_on");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\building_switched_off");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\building_active");
            Switcher tab = new Switcher(mSpriteBatch, texture, texture2, texture3);
            tab.Position = new Vector2(5, 365);
            tab.Click += tab_Click;
            tab.IsSwitchedOn = true;
            mControls.Add(tab);
            mTabs.Add(tab);

            texture = mContentManager.Load<Texture2D>("textures\\UI\\weapon_switched_on");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\weapon_switched_off");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\weapon_active");
            tab = new Switcher(mSpriteBatch, texture, texture2, texture3);
            tab.Position = new Vector2(66, 364);
            tab.Click += tab_Click;
            mControls.Add(tab);
            mTabs.Add(tab);

            texture = mContentManager.Load<Texture2D>("textures\\UI\\extra_switched_on");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\extra_switched_off");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\extra_active");
            tab = new Switcher(mSpriteBatch, texture, texture2, texture3);
            tab.Position = new Vector2(132, 364);
            tab.Click += tab_Click;
            mControls.Add(tab);
            mTabs.Add(tab);

            texture = mContentManager.Load<Texture2D>("textures\\UI\\bullets_Tab");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\bullets_Tab");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\bullets_Tab");
            tab = new Switcher(mSpriteBatch, texture, texture2, texture3);
            tab.Position = new Vector2(300, 364);
            tab.Click += tab_Click;
            mControls.Add(tab);
            mTabs.Add(tab);

            texture = mContentManager.Load<Texture2D>("textures\\UI\\Upgrades_tab");
            texture2 = mContentManager.Load<Texture2D>("textures\\UI\\Upgrades_tab");
            texture3 = mContentManager.Load<Texture2D>("textures\\UI\\Upgrades_tab");
            tab = new Switcher(mSpriteBatch, texture, texture2, texture3);
            tab.Position = new Vector2(500, 364);
            tab.Click += tab_Click;
            mControls.Add(tab);
            mTabs.Add(tab);
        }
Beispiel #3
0
 private void CreateGunTab()
 {
     Texture2D texture;
     Texture2D texture2;
     Texture2D texture3;
     texture = mContentManager.Load<Texture2D>("textures\\UI\\box4_switched_on");
     texture2 = mContentManager.Load<Texture2D>("textures\\UI\\box4_switched_off");
     texture3 = mContentManager.Load<Texture2D>("textures\\UI\\box4_active");
     Switcher gunSwitch = new Switcher(mSpriteBatch, texture, texture2, texture3);
     gunSwitch.Position = new Vector2(10, 390);
     gunSwitch.Click += gunSwitch_Click;
     gunSwitch.IsSwitchedOn = true;
     mControls.Add(gunSwitch);
     mButtonsPerTab[1].Add(gunSwitch);
 }