Example #1
0
        private void GotoScreen(ScreenType targetScreenType)
        {
            currentScreenType = targetScreenType;
            switch (targetScreenType)
            {
            case ScreenType.Welcome:
                _ = new WelcomeForm {
                    panel1 = { Parent = panel1 }
                };
                break;

            case ScreenType.StatusBarCommon:
                _ = new StatusBarCommonForm {
                    panel1 = { Parent = panel1 }
                };
                StatusBar = statusBar1;
                break;

            case ScreenType.MainWindowCommon:
                _ = new MainMenuForm(this)
                {
                    panel1 = { Parent = panel1 }
                };
                break;

            case ScreenType.TextBox:
                MainMenu.Items.Clear();
                _ = new TextBoxForm {
                    panel1 = { Parent = panel1 }
                };
                break;
            }
        }
Example #2
0
 public virtual void Activate(ScreenType prevScreen)
 {
     foreach (var w in widgets)
     {
         w.Active = true;
     }
 }
Example #3
0
    public GameScreen()
    {
        Game.GameSocket.OnDisconnectionEvent += DisconnectWhenError;

        NextScreen  = ScreenType.None;
        map         = new Map();
        localPlayer = new LocalPlayer(Game.PlayerSelectedType);
        bullets     = new BulletCollection();
        players     = new PlayerCollection();
        camera      = new Camera((ushort)Hardware.ScreenWidth,
                                 (ushort)Hardware.ScreenHeight);
        cameraController = new SpectatorCameraController();

        teamButtons = new Button[3];
        teamButtons[RED_TEAM_BUTTON]       = new Button(ButtonType.RedTeamButton);
        teamButtons[SPECTATOR_TEAM_BUTTON] = new Button(ButtonType.SpectatorTeamButton);
        teamButtons[BLUE_TEAM_BUTTON]      = new Button(ButtonType.BlueTeamButton);
        //Sets the positions of the buttons to change the team
        teamButtons[RED_TEAM_BUTTON].SetPos(100,
                                            Hardware.ScreenHeight / 2 - Button.SPRITE_HEIGHT / 2);
        teamButtons[SPECTATOR_TEAM_BUTTON].SetPos
            (Hardware.ScreenWidth / 2 - Button.SPRITE_WIDTH / 2,
            Hardware.ScreenHeight / 2 - Button.SPRITE_HEIGHT / 2);
        teamButtons[BLUE_TEAM_BUTTON].SetPos
            (Hardware.ScreenWidth - Button.SPRITE_WIDTH - 100,
            Hardware.ScreenHeight / 2 - Button.SPRITE_HEIGHT / 2);

        isChangingTeam            = true;
        messageBuffer             = "";
        CurrentUpdateGameFunction = UpdateGameStateSpectator;
        CurrentRenderGameFunction = RenderGameDead;
        deltaTime = 1;
    }
        public void AddObserver(ScreenType screenType, IListenerScreen listenerScreen)
        {
            switch (screenType)
            {
            case ScreenType.GameMenu:
                _screenFactory.GetGameMenu().ShowUI += listenerScreen.ShowScreen;
                _screenFactory.GetGameMenu().HideUI += listenerScreen.HideScreen;
                _screenFactory.GetGameMenu().Hide();
                break;

            case ScreenType.MainMenu:
                _screenFactory.GetMainMenu().ShowUI += listenerScreen.ShowScreen;
                _screenFactory.GetMainMenu().HideUI += listenerScreen.HideScreen;
                _screenFactory.GetMainMenu().Hide();
                break;

            case ScreenType.RestartMenu:
                _screenFactory.GetRestartMenu().ShowUI += listenerScreen.ShowScreen;
                _screenFactory.GetRestartMenu().HideUI += listenerScreen.HideScreen;
                _screenFactory.GetRestartMenu().Hide();
                break;


            default:
                break;
            }
        }
Example #5
0
    /// <summary>
    /// Main screen switching function
    /// </summary>
    /// <param name="screen">Screen to switch to</param>
    private void SwitchToScreen(ScreenType screen)
    {
        if (switchingScene)
        {
            return;
        }
        //make sure screen exists in dictionary
        UIScreen screenHolder;

        screens.TryGetValue(screen, out screenHolder);

        if (screenHolder != null)
        {
            switchingScene = true;
            Sequence seq = DOTween.Sequence();
            if (activeScreen != null)
            {
                seq.Append(activeScreen.TweenOut());
            }
            seq.Append(screens[screen].TweenIn());

            seq.OnComplete(() => OnSwitchScreenEnd(screen));
            seq.Play();
        }
    }
Example #6
0
 private void DisconnectWhenError()
 {
     Game.EndMessage = Game.LanguageTranslation
                       [Game.GameLanguage + "LostConnection"];
     Game.GameSocket.Disconnect();
     NextScreen = ScreenType.End;
 }
        public override void InitScreen(ScreenType screenName)
        {
            Sprites.Clear();
            AdditionalSprites.Clear();
            _firstInit = true;
            gamerInfos = null;
            GamerInfos.Clear();
            SelectedShips.Clear();

            base.InitScreen(screenName);

            BackgroundSprite = HorizontalMenuBGSprite.CurrentBG;
            title = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.BoldText, StateManager.NetworkData.SessionMode.ToFriendlyString() + " Lobby", Color.White);
            title.Y = 5;
            title.X = title.GetCenterPosition(Graphics.Viewport).X;
            AdditionalSprites.Add(title);

            StartButton = new Sprite(GameContent.Assets.Images.Controls.Button, new Vector2(0, Graphics.Viewport.Height), Sprites.SpriteBatch);
            StartButton.X = StartButton.GetCenterPosition(Graphics.Viewport).X;
            StartButton.Y -= StartButton.Height + 20;
            StartLabel = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.NormalText, "Start", Color.White) { ParentSprite = StartButton, IsHoverable = true, HoverColor = Color.MediumAquamarine, NonHoverColor = Color.White };
            StartLabel.Pressed += new EventHandler(StartLabel_Pressed);
            StartButton.Visible = false;
            StartLabel.Visible = false;
            Sprites.Add(StartButton);
            AdditionalSprites.Add(StartLabel);

            #if XBOX
            AllButtons = new GamePadButtonEnumerator(new TextSprite[,] { { StartLabel } }, InputType.LeftJoystick);
            AllButtons.FireTextSpritePressed = true;
            #endif
        }
Example #8
0
        public HumanAIScreen(Game1 game)
        {
            this._game = game;
            this._screen = ScreenType.Character;
            this.clientBounds = game.Window.ClientBounds;
            this._game.IsMouseVisible = false;

            arrowInputSystemID = game.RegisterSystem(new ArrowInputSystem(game, 1));
            handInitSystemID = game.RegisterSystem(new HandInitSystem(game));
            controllerInputSystemID = game.RegisterSystem(new ControllerInputSystem(game, 2));
            selectsInputID1 = game.RegisterSystem(new SelectInputSystem(game, 1));
            selectsInputID2 = game.RegisterSystem(new SelectInputSystem(game, 2));
            mapRendererID = game.RegisterSystem(new MapRenderer(game));
            handRenderID = game.RegisterSystem(new HandRenderer1(game));
            screenInitSystemID = game.RegisterSystem(new ScreenInitializationSystem(game));

            game.SetSystemCallOrder(new List<int>
             {
                screenInitSystemID,
                handInitSystemID,
                arrowInputSystemID,
                controllerInputSystemID,
                selectsInputID1,
                selectsInputID2,
                mapRendererID,
                handRenderID
             });

            game.AddObject(new HandObject1(game, 1));
            game.AddObject(new HandObject1(game, 2));
        }
Example #9
0
 public void ShowThisScreen(ScreenType _screenToShow, EnableDirection _direction, Action _tempAction = null)
 {
     _previousScreen = _currentScreen;
     ScreenView m_screen = FindScreen(_screenToShow);
     _currentScreen = _screenToShow;
     m_screen.Show(_direction);
 }
        /// <summary>
        /// Call this function to load the panel with current data.
        /// </summary>
        /// <param name="callingScreen">String variable of "Character", "Class" or "Race"</param>
        /// <param name="id">The GUID of the main record or empty guid for new records.</param>
        public void Initialize(string callingScreen, Guid id)
        {
            //set the Screentype so we know what models we are working with.
            if (callingScreen == "Character")
            {
                MainScreen = ScreenType.Character;
            }
            else if (callingScreen == "Class")
            {
                MainScreen = ScreenType.Class;
            }
            else if (callingScreen == "Race")
            {
                MainScreen = ScreenType.Race;
            }
            else
            {
                Debug.WriteLine("Error: Unknown ScreenType in AutoGrantedFeatsPanel()");
            }

            //Set Record ID
            MainRecordId = id;

            //Load the Model data into are variables
            PopulateData();
            //Create the controls needed to show the records
            CreateControls();
            //populate those controls with our model data
            PopulateControls();
        }
Example #11
0
 public static void ShowScreen(ScreenType type)
 {
     Time.timeScale       = 0.0f;
     _currentActiveScreen = _instance.GetScreen(type);
     _currentActiveScreen.Show();
     BlackScreen.Show();
 }
Example #12
0
        protected override void Update(GameTime gameTime)
        {
            var keyState = Keyboard.GetState(PlayerIndex.One);

            if (screenType == ScreenType.Splash)
            {
                splashTimeElapsed += gameTime.ElapsedGameTime.Milliseconds;
                if (splashTimeElapsed >= 3000)
                {
                    screenType = ScreenType.Drive;
                }
            }
            else
            {
                if (keyState.IsKeyDown(Keys.Enter))
                {
                    DroneTakeOff();
                }
                if (keyState.IsKeyDown(Keys.Escape))
                {
                    droneClient.Land();
                }
                if (keyState.IsKeyDown(Keys.E))
                {
                    droneClient.Emergency();
                }
                UpdateFrame();
            }
            kinectStatusMessage = (kinect != null) ? kinect.StatusMessage : string.Empty;
            base.Update(gameTime);
        }
Example #13
0
 private void ShowHelpText()
 {
     currentScreenType = ScreenType.Help;
     displayText       = true;
     displayScreen.Raise();
     helpScreen.Raise();
 }
Example #14
0
        private void OnChangeScreen(object sender, ScreenType screenType)
        {
            _currentScreenType = screenType;
            switch (_currentScreenType)
            {
            case ScreenType.MainMenu:
                _currentScreen = MainScreen;
                break;

            case ScreenType.LevelSelector:
                _currentScreen = LevelSelectorScreen;
                break;

            case ScreenType.Game:
                _currentScreen = LevelScreen;
                break;

            case ScreenType.Exit:
                Exit();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(screenType));
            }
        }
        //public static readonly IEnumerable<string> Browsers = new List<string> { "chrome", "firefox" };
        //public static readonly IEnumerable<string> Browsers = new List<string> { "chrome", "ie", "firefox" };

        /// <summary>
        /// Gets the screen size for the screen type passed in
        /// </summary>
        public static ScreenSize GetScreenSize(ScreenType screenType)
        {
            ScreenSize screenSize;

            switch (screenType)
            {
            case ScreenType.Tiny:
                screenSize = new ScreenSize(568, 320);     // IPhone 5
                break;

            case ScreenType.Small:
                screenSize = new ScreenSize(667, 375);     // IPhone 6
                break;

            case ScreenType.Medium:
                screenSize = new ScreenSize(1024, 768);     // IPad
                break;

            case ScreenType.Large:
                screenSize = new ScreenSize(1366, 768);     // Laptop [My Dell]
                break;

            default:
                screenSize = new ScreenSize(1366, 768);     // Monitor
                break;
            }

            return(screenSize);
        }
Example #16
0
        public override void InitScreen(ScreenType screenName)
        {
            base.InitScreen(screenName);
            BaseAllyShip.Dead += new EventHandler(BaseAllyShip_Dead);
            Texture2D buttonImage = GameContent.Assets.Images.Controls.Button;
            SpriteFont SegoeUIMono = GameContent.Assets.Fonts.NormalText;
            BackgroundSprite = HorizontalMenuBGSprite.CurrentBG;

            gameOverLabel = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * .5f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .1f), SegoeUIMono, string.Format("\n    GAME OVER\n you had {0} points,\n {1} spacebucks,\n and was on {2}", StateManager.SpacePoints, StateManager.SpaceBucks, StateManager.HighestUnlockedLevel));
            gameOverLabel.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * .5f - gameOverLabel.Width / 2, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .1f - gameOverLabel.Height / 2);
            gameOverLabel.Color = Color.Red;

            Sprite MainMenuButton = new Sprite(buttonImage, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * .5f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .5f), Sprites.SpriteBatch);
            MainMenuButton.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * .5f - MainMenuButton.Width / 2, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .5f - MainMenuButton.Height / 2);
            mainMenuLabel = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, SegoeUIMono, "Main Menu");
            mainMenuLabel.Position = new Vector2((MainMenuButton.X + MainMenuButton.Width / 2) - mainMenuLabel.Width / 2, (MainMenuButton.Y + MainMenuButton.Height / 2) - mainMenuLabel.Height / 2);
            #if WINDOWS
            mainMenuLabel.CallKeyboardClickEvent = false;
            #endif
            mainMenuLabel.Color = Color.White;
            mainMenuLabel.IsHoverable = true;
            mainMenuLabel.IsManuallySelectable = true;
            mainMenuLabel.NonHoverColor = Color.White;
            mainMenuLabel.HoverColor = Color.MediumAquamarine;

            AdditionalSprites.Add(mainMenuLabel);
            Sprites.Add(MainMenuButton);
            AdditionalSprites.Add(gameOverLabel);

            #if WINDOWS
            MainMenuButton.MouseEnter +=new EventHandler(MainMenuButton_MouseEnter);
            MainMenuButton.MouseLeave +=new EventHandler(MainMenuButton_MouseLeave);
            #endif
        }
Example #17
0
 public void ShowNotificationMessage(String message)
 {
     NextScreen = CurrentScreen;
     OpenScreenByType(ScreenType.NotificationScreen);
     menuCanvasManager.GetNotificationCanvasController().SetNotificationMessage(message);
     shows_error = true;
 }
Example #18
0
 private void Enter(ScreenType screenType)
 {
     _screens[_activeScreen].Leave();
     _lastScreen   = _activeScreen;
     _activeScreen = screenType;
     _manager.EnterMainMenu();
 }
Example #19
0
 /// <summary>
 /// Thay đổi loại của tất cả các điểm trên màn hình chơi
 /// </summary>
 /// <param name="p">mảng các điểm</param>
 public void ChangeTypeAll(Point[] p, ScreenType type)
 {
     foreach (Point x in p)
     {
         point[x.X, x.Y] = type;
     }
 }
    /// <summary>
    /// Toggles between screen types.
    /// It also enables info window if it is disabled, and disables it when called with screen type which is currently shown
    /// </summary>
    /// <param name='type'>
    /// screen type
    /// </param>
    public void toggleScreen(ScreenType type)
    {
        bool wasEnabled = infoScreenCamera.camera.enabled;

        if (type == currentScreen) {
            infoScreenCamera.camera.enabled = !infoScreenCamera.camera.enabled;
        } else {
            infoScreenCamera.camera.enabled = true;
        }

        if (infoScreenCamera.camera.enabled != wasEnabled) {
            WidgetEventDispather.Instance.notifyInfoWindowStateChange(infoScreenCamera.camera.enabled);
        }

        Vector3 tmp;

        tmp = infoScreens[(int)currentScreen].transform.parent.localPosition;
        tmp.y = -1000;
        infoScreens[(int)currentScreen].transform.parent.localPosition = tmp;

        currentScreen = type;

        tmp = infoScreens[(int)currentScreen].transform.parent.localPosition;
        tmp.y = 0;
        infoScreens[(int)currentScreen].transform.parent.localPosition = tmp;

        infoScreens[(int)currentScreen].screenToggled();
    }
        public override void InitScreen(ScreenType screenType)
        {
            Shop.PurchaseScreenSelected += new EventHandler(Shop_PurchaseScreenSelected);
            Texture2D tempImage = GameContent.Assets.Images.NonPlayingObjects.Planet;
            Texture2D ScannerImage = GameContent.Assets.Images.Equipment[EquipmentType.Scanner, TextureDisplayType.ShopDisplay];
            SpriteFont font = GameContent.Assets.Fonts.NormalText;

            //scanner

            SpaceBuckAmount = new TextSprite(Sprites.SpriteBatch, font, string.Format("You have {0} credits", StateManager.SpaceBucks), Color.White);
            SpaceBuckAmount.Position = Vector2.Zero;
            AdditionalSprites.Add(SpaceBuckAmount);
            Sprite Scanner = new Sprite(ScannerImage, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.6f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), Sprites.SpriteBatch);
            TextSprite scannerText = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.1f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 1.5f), font, "Scanner", Color.White);
            text4 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.1f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 1.5f), font,
            "\n\nScanner\nCost: 2500\nShows enemy health bars as well as\ntheir health and rotation on the minimap\nCurrently lasts until game ends", Color.White);
            text4.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.01f);
            Scanner.Scale = new Vector2(0.5f, 0.5f);
            scannerText.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.4f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.01f);
            itemsShown.Add(new KeyValuePair<Sprite, string>(Scanner, StateManager.SpaceBucks.ToString()));
            items.Add(new KeyValuePair<Sprite, TextSprite>(Scanner, text4));

            ChangeItem += new EventHandler(UpgradeScreen_ChangeItem);

            nextButtonClicked += new EventHandler(UpgradeScreen_nextButtonClicked);

            base.InitScreen(screenType);
            acceptLabel.Text = "Buy";
        }
Example #22
0
    public void PopAndPushAsync(string pushSceneName, string popSceneName, ScreenType screenType)
    {
        var lastIndex = screenList.Count - 1;
        var popIndex  = screenList.IndexOf(screenList.Where(x => x.Name == popSceneName).SingleOrDefault()) - 1;

        for (int i = lastIndex; i > popIndex; i--)
        {
            screenList.RemoveAt(i);
        }

        switch (screenType)
        {
        case ScreenType.Single:
            SceneManager.LoadSceneAsync(pushSceneName, LoadSceneMode.Single);
            break;

        case ScreenType.Additive:
            SceneManager.LoadSceneAsync(pushSceneName, LoadSceneMode.Additive);
            break;

        default:
            break;
        }

        screenList.Add(new BTSScreen(pushSceneName, screenType));
    }
Example #23
0
    void PasswordEnter(string enteredPassword = null)
    {
        //Password accepted.
        if (enteredPassword == currentCommandMenu.password)
        {
            computerAudioSource.PlayOneShot(computerSounds.audioDict[ComputerSounds.Clips.Accept]);

            menuScreens.Find(x => x.sentString == currentCommandMenu.commandText).Raise();

            //if (currentCommandMenu.commandText.Equals(CommonCompStrings.cmdDict[CommonCompStrings.Command.Email], System.StringComparison.Ordinal))
            //{
            //    ShowEmailMenu();
            //}

            //set the hacked to true, so user doesn't have to hack again.
            currentCommandMenu.alreadyHacked = true;

            currentScreenType = ScreenType.PasswordSucceed;
            displayScreen.Raise();
            passwordSuccScreen.Raise();
        }
        else if (enteredPassword.Equals(CommonCompStrings.charDict[CommonCompStrings.Char.Empty], System.StringComparison.Ordinal))
        {
            ShowMenu(menus.Commands.Find(x => x.commandText.Equals("home", System.StringComparison.Ordinal)));
        }
        //Password failed.
        else
        {
            computerAudioSource.PlayOneShot(computerSounds.audioDict[ComputerSounds.Clips.Error]);
            currentScreenType = ScreenType.PasswordFail;
            passwordFailScreen.Raise();
        }
    }
Example #24
0
    public void SwitchState(ScreenType state)
    {
        switch (state)
        {
        case ScreenType.Email:
            emailDisplayCanvas.alpha = 1;
            emailMenuCanvas.alpha    = 0;
            emailParentCanvas.alpha  = 1;
            break;

        case ScreenType.EmailMenu:
            emailMenuCanvas.alpha    = 1;
            emailDisplayCanvas.alpha = 0;
            emailParentCanvas.alpha  = 1;
            CreateEmailText(pageIndex);
            break;

        default:
            emailMenuCanvas.alpha    = 0;
            emailDisplayCanvas.alpha = 0;
            emailParentCanvas.alpha  = 0;
            pageIndex = 0;
            break;
        }
    }
Example #25
0
    /// <summary>
    /// Toggles between screen types.
    /// It also enables info window if it is disabled, and disables it when called with screen type which is currently shown
    /// </summary>
    /// <param name='type'>
    /// screen type
    /// </param>
    public void toggleScreen(ScreenType type)
    {
        bool wasEnabled = infoScreenCamera.camera.enabled;

        if (type == currentScreen)
        {
            infoScreenCamera.camera.enabled = !infoScreenCamera.camera.enabled;
        }
        else
        {
            infoScreenCamera.camera.enabled = true;
        }

        if (infoScreenCamera.camera.enabled != wasEnabled)
        {
            WidgetEventDispather.Instance.notifyInfoWindowStateChange(infoScreenCamera.camera.enabled);
        }

        Vector3 tmp;

        tmp   = infoScreens[(int)currentScreen].transform.parent.localPosition;
        tmp.y = -1000;
        infoScreens[(int)currentScreen].transform.parent.localPosition = tmp;

        currentScreen = type;

        tmp   = infoScreens[(int)currentScreen].transform.parent.localPosition;
        tmp.y = 0;
        infoScreens[(int)currentScreen].transform.parent.localPosition = tmp;


        infoScreens[(int)currentScreen].screenToggled();
    }
Example #26
0
    private void show(ScreenType type)
    {
        background.sprite = type == ScreenType.SHIP? shipBG: type == ScreenType.EQUIPMENT? equipmentBG: type == ScreenType.PERKS? perksBG: cabinBG;

        setCashTxtActive(type == ScreenType.SHIP || type == ScreenType.EQUIPMENT);

        repairBtn.setVisible(onPlanetSurface && type == ScreenType.SHIP && shipData.repairCost > 0);

        itemDescriptor.setAsPerkDescriptor(type == ScreenType.PERKS);

        shipData.gameObject.SetActive(type == ScreenType.SHIP);
        playerData.gameObject.SetActive(type == ScreenType.EQUIPMENT);
        inventory.gameObject.SetActive(type == ScreenType.EQUIPMENT || type == ScreenType.SHIP);
        perksView.gameObject.SetActive(type == ScreenType.PERKS);
        cabin.gameObject.SetActive(type == ScreenType.CABIN);

        playerBtn.setActive(type != ScreenType.EQUIPMENT);
        shipBtn.setActive(type != ScreenType.SHIP);
        perksBtn.setActive(type != ScreenType.PERKS);
        cabinBtn.setActive(type != ScreenType.CABIN);

        hideItemInfo();

        lastOpened = type;
    }
Example #27
0
 /// <summary>
 /// Parameterized contstructor.
 /// </summary>
 /// <param name="text"></param>
 /// <param name="name"></param>
 /// <param name="type"></param>
 public Screen( string text, string name, ScreenType type )
 {
     _name = name;
     _contents = text;
     _type = type;
     _active = false;
 }
Example #28
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public Screen()
 {
     _name = String.Empty;
     _contents = String.Empty;
     _type = ScreenType.none;
     _active = false;
 }
Example #29
0
    // Use this for initialization
    void Start()
    {
        serverSysFile = Logger.Path() + "server.sys";

        GetPlayerName();

        //if (Authenticated)
        CurrentScreen = ScreenType.MainMenu;
        //else
        //CurrentScreen = ScreenType.Login;

        float boxWidth  = Screen.width * 0.25f;
        float boxHeight = Screen.height * 0.5f;

        creditsRect       = new Rect(0, Screen.height - boxHeight, boxWidth, boxHeight);
        creditsScrollView = new Rect(creditsRect.x + 8, creditsRect.y + 8, boxWidth - 16, boxHeight - 16);

        if (PlayerPrefs.GetInt("GameTips", 1) == 1)
        {
            GameTips = true;
        }
        else
        {
            GameTips = false;
        }
    }
Example #30
0
    //Handles all the buttons events
    public void HandleEvents()
    {
        while (SDL.SDL_PollEvent(out SDL.SDL_Event e) != 0)
        {
            foreach (Button b in buttons)
            {
                b.HandleEvents(e);
            }
        }

        if (buttons[ASSAULT_PLAYER].IsClicked)
        {
            Game.PlayerSelectedType = PlayerType.Assault;
            NextScreen = ScreenType.Connect;
        }
        else if (buttons[COMMANDER_PLAYER].IsClicked)
        {
            Game.PlayerSelectedType = PlayerType.Commander;
            NextScreen = ScreenType.Connect;
        }
        else if (buttons[RUSHER_PLAYER].IsClicked)
        {
            Game.PlayerSelectedType = PlayerType.Rusher;
            NextScreen = ScreenType.Connect;
        }
        else if (buttons[3].IsClicked)
        {
            Game.PlayerSelectedType = PlayerType.Tank;
            NextScreen = ScreenType.Connect;
        }
    }
Example #31
0
        public override void InitScreen(ScreenType screenType)
        {
            base.InitScreen(screenType);

            bold   = GameContent.GameAssets.Fonts.BoldText;
            normal = GameContent.GameAssets.Fonts.NormalText;
            StateManager.ScreenStateChanged += new EventHandler(delegate(object src, EventArgs arg)
            {
                if (Visible)
                {
                    if (StateManager.Options.MusicEnabled)
                    {
                        if (MediaPlayer.State == MediaState.Paused)
                        {
                            MediaPlayer.Resume();
                        }
                        else
                        {
                            MediaPlayer.Play(_gameSong);
                        }
                    }
                    else
                    {
                        MediaPlayer.Stop();
                    }
                }
            });
            StateManager.Options.ScreenResolutionChanged += new EventHandler(Options_ScreenResolutionChanged);

            _gameSong = GameContent.GameAssets.Music[ScreenMusic.Level1];

            bgImg = GameContent.GameAssets.Images.Backgrounds.Levels[GameLevel.Level1];
        }
Example #32
0
        private IHttpHandler GetAppPagesHandler(RequestContext requestContext, string virtualPath)
        {
            string pageName = requestContext.RouteData.GetRequiredString("page");

            string[] urlSegments = requestContext.HttpContext.Request.Url.Segments;
            string   folder      = requestContext.RouteData.GetRequiredString("folder"); //urlSegments[urlSegments.Length - 2].Replace("/", "");

            Screen screen = Screen.GetByFolderAndName(folder, pageName);

            if (screen != null)
            {
                ScreenType screenType = ScreenType.GetScreenType(screen);

                if (screenType == null)
                {
                    throw new ApplicationException(String.Format("Screen type {0} could not be found in configuration", screen.Type));
                }

                virtualPath = screenType.TemplateFile;
            }
            else
            {
                virtualPath = "~/Templates/Pages/PageNotFound.aspx";
            }


            return((virtualPath != null)
                ? (IHttpHandler)BuildManager.CreateInstanceFromVirtualPath(virtualPath, typeof(T))
                : new T());
        }
Example #33
0
        public T ShowScreen <T>(ScreenType type) where T : BaseScreen
        {
            HidePreviousDialog();
            switch (type)
            {
            case ScreenType.CITY:
                _currentScreen = Instantiate(_cityScreen);
                break;

            case ScreenType.BATTLE_SEARCH:
                _currentScreen = Instantiate(_battleSearchScreen);
                break;

            case ScreenType.HOME:
                _currentScreen = Instantiate(_homeScreen);
                break;

            case ScreenType.BATTLE:
                break;

            default:
                throw new ArgumentOutOfRangeException("type", type, null);
            }
            _currentScreen.transform.SetParent(_mainCanvas.transform, false);
            return((T)_currentScreen);
        }
Example #34
0
    public void ChangeScreen(ScreenType newScreen)
    {
        //if (_AudioManager)
        // _AudioManager.PlayClip(_AudioManager.clickSound, _AudioManager.GetChannel("SFX"));
        endGameDialogue.SetActive(false);
        Destroy(carryingItem);

        prevScreen = currentScreen;
        screens[currentScreen].SetActive(false);
        screens[newScreen].SetActive(true);
        currentScreen = newScreen;
        mouseHoverTip.SetActive(false);

        // UI Requirements
        if (charUI)
        {
            if (currentScreen == ScreenType.STHubMap || currentScreen == ScreenType.STWorldMap || currentScreen == ScreenType.STClinic || currentScreen == ScreenType.STMarket || currentScreen == ScreenType.STEnMap1 || currentScreen == ScreenType.STEnMap2 || currentScreen == ScreenType.STEnMap3 || currentScreen == ScreenType.STCampfire)
            {
                charUI.SetActive(true);
            }
            else
            {
                charUI.SetActive(false);
            }
        }
        if (newScreen == ScreenType.STEnMap1 || newScreen == ScreenType.STEnMap2 || newScreen == ScreenType.STEnMap3)
        {
            screens[ScreenType.STEncounter].SetActive(true);
        }

        //if (confirmTravelPanel)
        //confirmTravelPanel.SetActive(false);
    }
Example #35
0
        public MapScreen(Game1 game)
        {
            this._game = game;
            this._screen = ScreenType.Map;
            this.clientBounds = game.Window.ClientBounds;
            this._game.IsMouseVisible = true;

            arrowInputSystemID = game.RegisterSystem(new ArrowInputSystem(game, 1));
            controllerInputSystemID = game.RegisterSystem(new ControllerInputSystem(game, 1));
            mapRendererID = game.RegisterSystem(new MapRenderer(game));
            mapInitSystemID = game.RegisterSystem(new ScreenInitializationSystem(game));
            //modeRendererID = game.RegisterSystem(new ModeTextRenderer(game));
            modeInputSystemID = game.RegisterSystem(new ModeInputSystem(game));
            mapInputSystemID = game.RegisterSystem(new MouseInputsystem(game));

            game.SetSystemCallOrder(new List<int>
             {
                mapInitSystemID,
                arrowInputSystemID,
                controllerInputSystemID,
                modeInputSystemID,
                mapRendererID,
                mapInputSystemID
                //modeRendererID
             });

            game.AddObject(new TextObject1(game));
        }
Example #36
0
        public void RemoveObserver(ScreenType screenType, IListenerScreen listenerScreen)
        {
            switch (screenType)
            {
            case ScreenType.GameMenu:
                _screenFactory.GetGameMenu().ShowUI -= listenerScreen.ShowScreen;
                _screenFactory.GetGameMenu().HideUI -= listenerScreen.HideScreen;
                _screenFactory.GetGameMenu().Hide();
                break;

            case ScreenType.MainMenu:
                _screenFactory.GetMainMenu().ShowUI -= listenerScreen.ShowScreen;
                _screenFactory.GetMainMenu().HideUI -= listenerScreen.HideScreen;
                _screenFactory.GetMainMenu().Hide();
                break;

            case ScreenType.EndGameMenu:
                _screenFactory.GetEndGameMenu().ShowUI -= listenerScreen.ShowScreen;
                _screenFactory.GetEndGameMenu().HideUI -= listenerScreen.HideScreen;
                _screenFactory.GetEndGameMenu().Hide();
                break;

            default:
                break;
            }
        }
Example #37
0
    public void ChangeScreen(int iNewScreen)
    {
        if (_AudioManager && _AudioManager.GetChannel("SFX") != null && _AudioManager.clickSound)
        {
            _AudioManager.PlayClip(_AudioManager.clickSound, _AudioManager.GetChannel("SFX"));
        }
        Destroy(carryingItem);

        ScreenType newScreen = (ScreenType)iNewScreen;

        prevScreen = currentScreen;
        screens[currentScreen].SetActive(false);
        screens[newScreen].SetActive(true);
        currentScreen = newScreen;
        mouseHoverTip.SetActive(false);
        // UI Requirements
        if (charUI)
        {
            if (currentScreen == ScreenType.STHubMap || currentScreen == ScreenType.STWorldMap || currentScreen == ScreenType.STClinic || currentScreen == ScreenType.STMarket || currentScreen == ScreenType.STEnMap1 || currentScreen == ScreenType.STEnMap2 || currentScreen == ScreenType.STEnMap3)
            {
                charUI.SetActive(true);
            }
            else
            {
                charUI.SetActive(false);
            }
        }
        if (iNewScreen == 9 || iNewScreen == 10 || iNewScreen == 11)
        {
            screens[ScreenType.STEncounter].SetActive(true);
        }
    }
Example #38
0
        public void Execute(ScreenType screenType)
        {
            if (CurrentWindow != null)
            {
                CurrentWindow.Hide();
            }

            switch (screenType)
            {
            case ScreenType.GameMenu:
                _currentWindow = _screenFactory.GetGameMenu();
                break;

            case ScreenType.MainMenu:
                _currentWindow = _screenFactory.GetMainMenu();
                break;

            case ScreenType.EndGameMenu:
                _currentWindow = _screenFactory.GetEndGameMenu();
                break;

            default:
                break;
            }

            CurrentWindow.Show();
        }
Example #39
0
 public TitleScreen(ScreenType screenType)
     : base(screenType)
 {
     AddEntry(new Text("URSO'S ADVENTURES", new Vector2(ScreenManager.SCREENWIDTH / 2 - 160.0f, 100.0f)));
     AddEntry(new Text("Play game", new Vector2(100.0f, 100.0f)));
     AddEntry(new Text("Quit game", new Vector2(100.0f, 0.0f)));
     FormatEntries();
 }
Example #40
0
        public Screen(ScreenType type)
        {
            _type = type;
            _screenComponents = new List<ScreenComponent>();
            _componentsToRemove = new List<ScreenComponent>();

            loadContent();
            initialize();
        }
Example #41
0
 private LayoutManager(ScreenType screenType, bool hasFocus)
 {
     HasFocus = hasFocus;
     ScreenType = screenType;
     IsShowingModal = false;
     Components = new List<UiElement>();
     ModalComponents = new List<UiElement>();
     SetComponents(screenType);
 }
        public SimpleScreen(ScreenType type)
        {
            this.type = type;

            IsPopup = true;

            TransitionOnTime = TimeSpan.FromSeconds(0.2);
            TransitionOffTime = TimeSpan.FromSeconds(0);
        }
Example #43
0
 public PauseScreen(ScreenType screenType)
     : base(screenType)
 {
     AddEntry(new Text("PAUSE MENU", new Vector2(ScreenManager.SCREENWIDTH / 2 - 110.0f, 100.0f)));
     AddEntry(new Text("Return to game", new Vector2(100, 100.0f)));
     AddEntry(new Text("Return to title screen", new Vector2(100, 0.0f)));
     AddEntry(new Text("Quit game", new Vector2(100, 0.0f)));
     FormatEntries();
 }
Example #44
0
        /// <summary>Создаёт новый экземпляр класса <see cref="ScreenSettings"/>.</summary>
        /// <param name="node">Запись xml.</param>
        /// <exception cref="System.ArgumentNullException">Настройки экрана отсутствуют</exception>
        public ScreenSettings(XmlNode node)
        {
            if (node == null)
            throw new ArgumentNullException("Настройки экрана отсутствуют");

              Number = int.Parse(node.SelectSingleNode("Number").InnerText);
              Time = int.Parse(node.SelectSingleNode("Time").InnerText);
              Texture = node.SelectSingleNode("Texture").InnerText;
              Type = (ScreenType)Enum.Parse(typeof(ScreenType), node.SelectSingleNode("Type").InnerText);
              FadeIn = int.Parse(node.SelectSingleNode("FadeIn").InnerText);
              FadeOut = int.Parse(node.SelectSingleNode("FadeOut").InnerText);
        }
Example #45
0
	private void PushScreenWithSource(ScreenType screenType, GameScreen.AnimationType animType, ScreenType source)
	{
		if (screenType == ScreenType.Null) {
			throw new System.Exception("Trying to create null screen type");
		}	
		
		GameScreen screen = CreateScreen(screenType);
		screen.Setup(animType);
		screen.Open();
		screen.SetSource(source);
		_screenLayers.Push(screen);
	}
        public override void InitScreen(ScreenType screenType)
        {
            if (_firstTimeInit)
            {
                ChangeItem += new EventHandler(MulitplayerShipSelectScreen_ChangeItem);
                nextButtonClicked += new EventHandler(MulitplayerShipSelectScreen_nextButtonClicked);
            }

            fighterCarrier.Image = new Sprite(GameContent.Assets.Images.Ships[ShipType.FighterCarrier, ShipTier.Tier2], Vector2.Zero, Sprites.SpriteBatch);
            fighterCarrier.Image.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.81f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .12f);
            fighterCarrier.Image.Rotation = new SpriteRotation(90);
            fighterCarrier.Description = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, "\n\n This class fires an extremely fast\n Flak Cannon. However, the Flak\n Cannon isn't that powerful.\n\n Damage Per Shot: 2\n Amount of Health: 100\n Amount of Drones: 2\n Damage Per Drone Shot: 1\n Health Per Drone: 10");
            fighterCarrier.Description.Color = Color.White;
            fighterCarrier.Name = FighterCarrier.ShipFriendlyName;
            fighterCarrier.Type = ShipType.FighterCarrier;
            fighterCarrier.Tier = ShipTier.Tier2;

            items.Add(new KeyValuePair<Sprite, TextSprite>(fighterCarrier.Image, fighterCarrier.Description));

            MultiplayerShips.Add(fighterCarrier);

            battleCruiser.Image = new Sprite(GameContent.Assets.Images.Ships[ShipType.BattleCruiser, ShipTier.Tier2], Vector2.Zero, Sprites.SpriteBatch);
            battleCruiser.Image.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.81f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .12f);
            battleCruiser.Image.Rotation = new SpriteRotation(90);
            battleCruiser.Name = BattleCruiser.ShipFriendlyName;
            battleCruiser.Type = ShipType.BattleCruiser;
            battleCruiser.Tier = ShipTier.Tier2;

            battleCruiser.Description = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, "\n\n This is the strongest class \n in the fleet, but also the slowest.\n What it lacks in speed it makes \n up for in strength.\n\n Damage Per Shot: 20\n Amount of Health: 120");
            battleCruiser.Description.Color = Color.White;

            items.Add(new KeyValuePair<Sprite, TextSprite>(battleCruiser.Image, battleCruiser.Description));

            MultiplayerShips.Add(battleCruiser);

            torpedoShip.Image = new Sprite(GameContent.Assets.Images.Ships[ShipType.TorpedoShip, ShipTier.Tier2], Vector2.Zero, Sprites.SpriteBatch);
            torpedoShip.Image.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.81f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .12f);
            torpedoShip.Image.Rotation = new SpriteRotation(90);
            torpedoShip.Name = TorpedoShip.ShipFriendlyName;
            torpedoShip.Type = ShipType.TorpedoShip;
            torpedoShip.Description = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, "\n\n This class is the most balanced\n ship in the game. The torpedos do\n a lot of damage and \n are hard to dodge!\n\n Damege Per Shot: 5\n Amount of Health: 110");
            torpedoShip.Description.Color = Color.White;
            torpedoShip.Tier = ShipTier.Tier2;

            items.Add(new KeyValuePair<Sprite, TextSprite>(torpedoShip.Image, torpedoShip.Description));

            MultiplayerShips.Add(torpedoShip);

            base.InitScreen(screenType);
        }
		public ScreenList (ScreenController ctrl, ScreenType screen) : base()
		{
			this.ctrl = ctrl;
			this.engine = ctrl.Engine;
			this.type = screen;

			// Create source for table view
			screenListSource = new ScreenListSource(this, ctrl, screen);

			// OS specific details
			if (new Version (UIDevice.CurrentDevice.SystemVersion) >= new Version(7,0)) 
			{
				// Code that uses features from Xamarin.iOS 7.0
				this.EdgesForExtendedLayout = UIRectEdge.None;
			}
		}
    public void DisplayScreen(ScreenType screenType)
    {
      var screen = this.screens.FirstOrDefault(item => item.ScreenType == screenType);

      if (screen == null)
      {
        throw new Exception(
          string.Format(
            $"ScreenService.DisplayScreen - No screen was found matching screen type '{screenType}'. "
            + "Verify that the view initialized the screen type in the constructor in its code-behind "
            + "and that the screen was registered within the 'ScreenService.Initialize()' method.")
          );
      }

      this.ActiveScreen = screen;
    }
Example #49
0
        public override void InitScreen(ScreenType screenType)
        {
            ChangeItem +=new EventHandler(LevelSelect_ChangeItem);
            Texture2D planet1 = GameContent.Assets.Images.NonPlayingObjects.Planet;
            Texture2D planet2 = GameContent.Assets.Images.NonPlayingObjects.AltPlanet;
            Texture2D planet3 = GameContent.Assets.Images.NonPlayingObjects.Planet3;
            Texture2D planet4 = GameContent.Assets.Images.NonPlayingObjects.Planet4;

            //level1
            level1 = new Sprite(planet1, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.68f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.22f), Sprites.SpriteBatch);
            level1Label = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, "  Level 1");
            level1.Scale = new Vector2(0.7f);
            level1Label.Color = Color.Transparent;
            level1.Color = Color.White;

            //level2
            level2 = new Sprite(planet2, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.60f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), Sprites.SpriteBatch);
            level2Label = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, "  Level 2");
            level2.Scale = new Vector2(0.7f);

            //level3
            level3 = new Sprite(planet3, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.58f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), Sprites.SpriteBatch);
            level3Label = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, "  Level 3");
            level3Label.Color = Color.Transparent;
            level3.Scale = new Vector2(0.6f);

            //level4
            level4 = new Sprite(planet4, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.63f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), Sprites.SpriteBatch);
            level4Label = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, "  Level 4");
            level4.Scale = new Vector2(0.4f);

            items.Add(new KeyValuePair<Sprite, TextSprite>(level1, level1Label));
            items.Add(new KeyValuePair<Sprite, TextSprite>(level2, level2Label));
            items.Add(new KeyValuePair<Sprite, TextSprite>(level3, level3Label));
            items.Add(new KeyValuePair<Sprite, TextSprite>(level4, level4Label));

            nextButtonClicked += new EventHandler(LevelSelect_nextButtonClicked);
            ChangeItem += new System.EventHandler(LevelSelect_ChangeItem);

            base.InitScreen(screenType);
            acceptLabel.Text = "Shop";

            level1Label.Position = nameLabel.Position;
            level2Label.Position = nameLabel.Position;
            level3Label.Position = nameLabel.Position;
            level4Label.Position = nameLabel.Position;
        }
        public override void InitScreen(ScreenType screenName)
        {
            this.BackgroundSprite = HorizontalMenuBGSprite.CurrentBG;

            StateManager.levelCompleted += new EventHandler(StateManager_levelCompleted);
            ship = new Ship_Sprite(GameContent.Assets.Images.Ships[ShipType.FighterCarrier, ShipTier.Tier1], Vector2.Zero, Sprites.SpriteBatch);

            ship.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width, (float)StateManager.GraphicsManager.GraphicsDevice.Viewport.Height / 2 - 70);
            ship.Scale = new Vector2(0);
            ship.XSpeed = -3.5f;
            ship.YSpeed = -ship.XSpeed * .8f;
            ship.Rotation.Degrees = -90;

            planetTexture = GameContent.Assets.Images.NonPlayingObjects.Planet;
            Sprites.AddNewSprite(Vector2.Zero, planetTexture);
            Sprites.Add(ship);
            Sprites[0].Position = new Vector2((float)StateManager.GraphicsManager.GraphicsDevice.Viewport.Width - (float)Sprites[0].Texture.Width / 2, (float)StateManager.GraphicsManager.GraphicsDevice.Viewport.Height / 2 - 70);

            Sprite Button;
            Texture2D ButtonImage = GameContent.Assets.Images.Controls.Button;
            Vector2 ButtonPosition = new Vector2(155);
            Button = new Sprite(ButtonImage, ButtonPosition, Sprites.SpriteBatch);
            AdditionalSprites.Add(Button);

            TextSprite Continue = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.NormalText, string.Format("Continue"));
            Continue.Color = Color.Beige;
            Continue.ParentSprite = Button;
            AdditionalSprites.Add(Continue);
            Continue.Pressed += new EventHandler(Continue_Pressed);
            Continue.IsHoverable = true;
            Continue.NonHoverColor = Color.White;
            Continue.HoverColor = Color.MediumAquamarine;
            Button.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .40f, 300);

            winText = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.NormalText, "");
            winText.Color = Color.Beige;
            AdditionalSprites.Add(winText);
            winText.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * .30f, 50);

            #if XBOX
            allButton = new GamePadButtonEnumerator(new TextSprite[,] { { Continue } }, InputType.LeftJoystick) { FireTextSpritePressed = true };
            #endif

            base.InitScreen(screenName);
        }
 public override void Update(GameTime gameTime)
 {
     KeyboardState state = Keyboard.GetState();
     GamePadState gamePadState1 = GamePad.GetState(PlayerIndex.One);
     GamePadState gamePadState2 = GamePad.GetState(PlayerIndex.Two);
     if (curScreen == ScreenType.Start)
     {
         if (state.GetPressedKeys().Length > 0 || gamePadState1.IsButtonDown(Buttons.Start) || gamePadState2.IsButtonDown(Buttons.Start))
         {
                 this._game.curScreen = ScreenType.Mode;
                 this._game.RemoveAllSystems();
                 this._game.RemoveAllObjects();
                 //GameScreen gameScreen = new GameScreen(this._game, SpriteType.Yoshi, SpriteType.Yoshi);
                 //CharacterSelectScreen selectScreen = new CharacterSelectScreen(this._game);
                 ModeScreen modeScreen = new ModeScreen(this._game);
                 this._game.LoadScene();
         }
     }
 }
Example #52
0
	public void SetScreen(ScreenType screenId, params object[] inputs) {
		previousId = currentScreenId;
		currentScreenId = screenId;
		if (currentScreen) {
			currentScreen.Destroy();
		}
		
		Reset();
		
		switch (currentScreenId) {
			case ScreenType.GAME:
				currentScreen = new GameObject("GameScreen", typeof(GameScreen)).GetComponent<GameScreen>();				
			break;
		}
		
		currentScreen.name = currentScreen.GetType().ToString();
		currentScreen.Init(inputs);
		currentScreen.transform.parent = container;
	}
Example #53
0
        public StartScreen(Game1 game)
        {
            this._game = game;
            this._screen = ScreenType.Start;
            this.clientBounds = game.Window.ClientBounds;

            startScreenSystemID = game.RegisterSystem(new ScreenInputSystem(game, this._screen));
            screenInitSystemID = game.RegisterSystem(new ScreenInitializationSystem(game));
            screenRendererID = game.RegisterSystem(new MapRenderer(game));

            game.SetSystemCallOrder(new List<int>
             {
                 screenInitSystemID,
                 startScreenSystemID,
                 screenRendererID

             });

            game.AddObject(new SceneObject(game, this._screen));
        }
        public override void InitScreen(ScreenType screenName)
        {
            StateManager.ScreenStateChanged += new EventHandler(StateManager_ScreenStateChanged);
            StateManager.ScreenResolutionChanged += new EventHandler<ViewportEventArgs>(Options_ScreenResolutionChanged);

            base.InitScreen(screenName);
            BackgroundSprite = GameContent.Assets.Images.NonPlayingObjects.GlobalBackground;
            title = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.BoldText, "You Won!", Color.White);
            title.X = title.GetCenterPosition(Graphics.Viewport).X;
            title.Y = 12.5f;
            AdditionalSprites.Add(title);
            planet = Sprites.AddNewSprite(new Vector2(-3, Graphics.Viewport.Height - GameContent.Assets.Images.NonPlayingObjects.Planet.Height + 11), GameContent.Assets.Images.NonPlayingObjects.Planet);
            msg = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.NormalText, MessageText, Color.White);
            msg.Y = title.Y + title.Font.LineSpacing;
            AdditionalSprites.Add(msg);

            netScreenButton = Sprites.AddNewSprite(Vector2.Zero, GameContent.Assets.Images.Controls.Button);
            netScreenButton.Position = netScreenButton.GetCenterPosition(Graphics.Viewport);
            netScreenLabel = StateManager.CreateButtonTextSprite(false, "Multiplayer", netScreenButton, this);
            netScreenLabel.Pressed += StateManager.ButtonSFXHelper;
            netScreenLabel.Pressed += new EventHandler(netScreenLabel_Pressed);
        }
        public override void InitScreen(ScreenType screenName)
        {
            base.InitScreen(screenName);
            BackgroundSprite = HorizontalMenuBGSprite.CurrentBG;
            title = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.BoldText, "Available " + (StateManager.NetworkData.SessionType == NetworkSessionType.SystemLink ? "LAN" : "LIVE") + " Sectors");
            title.Color = Color.White;
            title.Y = 5;
            title.X = title.GetCenterPosition(Graphics.Viewport).X;

            reloadButton = new Sprite(GameContent.Assets.Images.Controls.Button, new Vector2(0, title.Y + title.Font.LineSpacing + 10), Sprites.SpriteBatch);
            reloadButton.X = reloadButton.GetCenterPosition(Graphics.Viewport).X;

            reload = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.NormalText, "Refresh");
            reload.ParentSprite = reloadButton;
            reload.NonHoverColor = Color.White;
            reload.HoverColor = Color.MediumAquamarine;

            reload.IsHoverable = true;
            reload.Pressed += new EventHandler(reload_Pressed);

            BackButton = new Sprite(GameContent.Assets.Images.Controls.Button, new Vector2(20, Graphics.Viewport.Height), Sprites.SpriteBatch);
            BackButton.Y -= BackButton.Height + 20;
            BackLabel = new TextSprite(Sprites.SpriteBatch, GameContent.Assets.Fonts.NormalText, "Back", Color.White) { IsHoverable = true, HoverColor = Color.MediumAquamarine, NonHoverColor = Color.White };
            BackLabel.ParentSprite = BackButton;
            BackLabel.Pressed += new EventHandler(BackLabel_Pressed);
            BackLabel.Visible = true;

            Sprites.Add(BackButton);

            AdditionalSprites.Add(title);
            AdditionalSprites.Add(reload);
            Sprites.Add(reloadButton);

            #if XBOX
            AllButtons = new GamePadButtonEnumerator(new TextSprite[,] { { reload }, { BackLabel } }, InputType.LeftJoystick);
            AllButtons.FireTextSpritePressed = true;
            #endif
        }
        public override void InitScreen(ScreenType screenName)
        {
            base.InitScreen(screenName);

            BackgroundSprite = HorizontalMenuBGSprite.CurrentBG;

            invincible = StateManager.CreateButtonTextSprite(false, null, null, this);
            invincible.Pressed += new EventHandler(invincible_Pressed);
            invincible.Pressed += new EventHandler(event_OnPressGeneral);

            infimoney = StateManager.CreateButtonTextSprite(false, null, null, this);
            infimoney.Y = invincible.Height;
            infimoney.Pressed += new EventHandler(infimoney_Pressed);
            infimoney.Pressed += new EventHandler(event_OnPressGeneral);

            shipSpeed = StateManager.CreateButtonTextSprite(false, null, null, this);
            shipSpeed.Y = infimoney.Height + infimoney.Y;
            shipSpeed.Pressed += new EventHandler(shipSpeed_Pressed);
            shipSpeed.Pressed += new EventHandler(event_OnPressGeneral);

            killall = StateManager.CreateButtonTextSprite(false, null, null, this);
            killall.Y = shipSpeed.Height + shipSpeed.Y;
            killall.Pressed += new EventHandler(killall_Pressed);
            killall.Pressed += new EventHandler(event_OnPressGeneral);

            emergencyheal = StateManager.CreateButtonTextSprite(false, null, null, this);
            emergencyheal.Y = killall.Height + killall.Y;
            emergencyheal.Pressed += new EventHandler(emergencyheal_Pressed);
            emergencyheal.Pressed += new EventHandler(event_OnPressGeneral);

            fowEnabled = StateManager.CreateButtonTextSprite(false, null, null, this);
            fowEnabled.Y = emergencyheal.Height + emergencyheal.Y;
            fowEnabled.Pressed += new EventHandler(fowEnabled_Pressed);
            fowEnabled.Pressed += new EventHandler(event_OnPressGeneral);

            UpdateTextSprites();
        }
Example #57
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            this._systems = new List<GameSystem>();
            this._objects = new List<GameObject>();
            this._services = new Dictionary<string, GameSystem>();
            this._systemsCallOrder = new List<int>();
            this.curScreen = ScreenType.Start;
            this.graphics.PreferredBackBufferWidth = 1200;
            this.graphics.PreferredBackBufferHeight = 800;
            this.graphics.ApplyChanges();
            this.CurrentPathfindingGraph = new AStarGraph(this, new List<AStarNode>());
            this.play1 = SpriteType.None;
            this.play2 = SpriteType.None;
            this.winner = 0;
            this.playe1 = PlayerType.None;
            this.playe2 = PlayerType.None;

            gameType = GameTypes.None;
            LivesOrTime = 0;
            this.mapType = MapType.Basic;
            this.Winner = null;
        }
Example #58
0
 public GameScreen(ScreenType screenType)
     : base(screenType)
 {
 }
Example #59
0
 public MapComponent(GameObject parent, ScreenType screen)
     : base(parent)
 {
     this.screenType = screen;
 }
Example #60
0
		/// <summary>
		/// Shows the screen.
		/// </summary>
		/// <param name="screenType">Screen type.</param>
		/// <param name="obj">Object to show.</param>
		public void ShowScreen(ScreenType screenType, object obj)
		{
			this.screenQueue.Enqueue(new Screens(screenType, obj));

			this.HandleScreenQueue();
		}