Example #1
0
        public void AddSavedSwarm(string name, EntryType type, List <Color> colors, ControlScreen screen)
        {
            SavedSwarmButton entry = new SavedSwarmButton(screen, name, type, colors, screen, bgSprite);

            entry.Initialize();
            menuEntries.Add(entry);
        }
Example #2
0
        /// <summary>
        /// Load Game Assets and initialize all screens
        /// </summary>
        protected override void LoadContent()
        {
            //Instantiate the singleton class GameContent and load all game assets
            GameContent gameContent = new GameContent(Content);

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Instantiate the singleton class HorizontalMenuBGSprite
            HorizontalMenuBGSprite scrollingBG = new HorizontalMenuBGSprite(GameContent.GameAssets.Images.Backgrounds.Screens[ScreenBackgrounds.GlobalScrollingBg], spriteBatch);


            //Initialize screens

            titleScreen = new Title(spriteBatch, new Delegates.QuitFunction(Exit));
            titleScreen.InitScreen(ScreenType.Title);
            titleScreen.Visible = true;

            shopScreen = new Shop(spriteBatch);
            shopScreen.InitScreen(ScreenType.Shop);

            controlScreen = new ControlScreen(spriteBatch);
            controlScreen.InitScreen(ScreenType.ControlScreen);

            mainMenuScreen = new MainMenu(spriteBatch);
            mainMenuScreen.InitScreen(ScreenType.MainMenu);

            creditsScreen = new Credits(spriteBatch);
            creditsScreen.InitScreen(ScreenType.Credits);

            gameScreen = new GameScreen(spriteBatch);
            gameScreen.InitScreen(ScreenType.Game);

            optionScreen = new Options(spriteBatch);
            optionScreen.InitScreen(ScreenType.Options);

            pauseScreen = new PauseScreen(spriteBatch);
            pauseScreen.InitScreen(ScreenType.Pause);

            shipSelectScreen = new ShipSelect(spriteBatch);
            shipSelectScreen.InitScreen(ScreenType.ShipSelect);

            weaponSelectScreen = new WeaponSelectScreen(spriteBatch);
            weaponSelectScreen.InitScreen(ScreenType.WeaponSelect);

            upgradeScreen = new UpgradeScreen(spriteBatch);
            upgradeScreen.InitScreen(ScreenType.UpgradeScreen);

            tierSelectScreen = new TierSelect(spriteBatch);
            tierSelectScreen.InitScreen(ScreenType.TierSelect);

            levelSelectScreen = new LevelSelect(spriteBatch);
            levelSelectScreen.InitScreen(ScreenType.LevelSelect);

            screenManager            = new ScreenManager(spriteBatch, Color.White, titleScreen, mainMenuScreen, creditsScreen, gameScreen, optionScreen, shopScreen, pauseScreen, shipSelectScreen, weaponSelectScreen, upgradeScreen, tierSelectScreen, levelSelectScreen, controlScreen);
            StateManager.AllScreens  = screenManager;
            StateManager.ScreenState = CoreTypes.ScreenType.Title;
        }
Example #3
0
 public void notifyDataChange(TypeDataChange typeUpdate, ControlScreen controlNotify)
 {
     foreach (ControlScreen controlScreen in this.listControlScreen)
     {
         if (controlScreen != controlNotify)
         {
             controlScreen.dataOfOtherControlChange(typeUpdate);
         }
     }
 }
Example #4
0
 public SavedSwarmButton(ControlScreen menu, string text, EntryType type, List<Color> colors, ControlScreen screen, Texture2D texture)
     : base(menu,text,type,screen,texture)
 {
     if (colors != null && colors.Count > 0)
     {
         Color1 = colors[0];
         if (colors.Count > 1)
         {
             Color2 = colors[1];
         }
         if (colors.Count > 2)
         {
             Color3 = colors[2];
         }
     }
 }
Example #5
0
 public SavedSwarmButton(ControlScreen menu, string text, EntryType type, List <Color> colors, ControlScreen screen, Texture2D texture)
     : base(menu, text, type, screen, texture)
 {
     if (colors != null && colors.Count > 0)
     {
         Color1 = colors[0];
         if (colors.Count > 1)
         {
             Color2 = colors[1];
         }
         if (colors.Count > 2)
         {
             Color3 = colors[2];
         }
     }
 }
Example #6
0
        //public MenuEntry(GameScreen menu, string text, EntryType type, SwarmScreenBase screen, Texture2D texture, SwarmScreenBase phyisicsscreen)
        //    : this(menu, text, type, screen, texture)
        //{
        //    _phyisicsGameScreen = phyisicsscreen;
        //}

        /// <summary>
        /// Constructs a new menu entry with the specified text.
        /// </summary>
        ///
        public MenuEntry(ControlScreen menu, string text, EntryType type, ControlScreen screen, Texture2D texture)
        {
            _text   = text;
            _screen = screen;
            _type   = type;
            _menu   = menu;
#if NETFX_CORE
            BaseScale = 1f;
#else
            BaseScale = 1f;
#endif
            _scale = 1f;
            //_width = 100;
            //_height = 40;
            _alpha = 1.0f;
            _menuItemBackground = texture;
        }
Example #7
0
 public void addControlScreen(ControlScreen cs)
 {
     listControlScreen.Add(cs);
 }
Example #8
0
        public void AddMenuItem(string name, EntryType type, ControlScreen screen)
        {
            MenuEntry entry = new MenuEntry(screen, name, type, screen, bgSprite);

            menuEntries.Add(entry);
        }
Example #9
0
 public void AddSavedSwarm(string name, EntryType type, List<Color> colors, ControlScreen screen)
 {
     SavedSwarmButton entry = new SavedSwarmButton(screen, name, type, colors, screen, bgSprite);
     entry.Initialize();
     menuEntries.Add(entry);
 }
Example #10
0
 public void AddMenuItem(string name, EntryType type, ControlScreen screen)
 {
     MenuEntry entry = new MenuEntry(screen, name, type, screen, bgSprite);
     menuEntries.Add(entry);
 }
 public void firstActive(ControlScreen control)
 {
     controlStreen = control;
     controlStreen.firstActive();
 }
 public void clickScreen(ControlScreen control)
 {
     controlStreen = control;
     controlStreen.screenClick();
 }