public ScoreboardPopupMenuScreen( ScreenManager screenManager, Slot[] slots ) { ScreenManager = screenManager; this.slots = slots; IsPopup = true; ContentManager content = screenManager.Game.Content; GraphicsDevice device = screenManager.GraphicsDevice; ImageMenuEntry entry; float x = device.Viewport.Width / 2; float yStart = .8f * device.Viewport.Height; float ySpace = .06f * device.Viewport.Height; float y = yStart; float screenScale = (float)device.Viewport.Height / 1080f; // Play Again entry = new ImageMenuEntry( this, new Vector2( x, y ), content.Load<Texture2D>( "Textures/playAgainText" ), null ); entry.Selected += PlayAgain; entry.TransitionOnPosition = entry.TransitionOffPosition = entry.Position + new Vector2( 0, ySpace * 5 ); entry.IdleScale = entryIdleScale * screenScale; entry.FocusScale = entryFocusScale * screenScale; entry.Focused = true; MenuItems.Add( entry ); // High Scores y += ySpace; entry = new ImageMenuEntry( this, new Vector2( x, y ), content.Load<Texture2D>( "Textures/highScoresText" ), null ); entry.Selected += ViewHighScores; entry.TransitionOnPosition = entry.TransitionOffPosition = entry.Position + new Vector2( 0, ySpace * 5 ); entry.IdleScale = entryIdleScale * screenScale; entry.FocusScale = entryFocusScale * screenScale; MenuItems.Add( entry ); // Exit y += ySpace; entry = new ImageMenuEntry( this, new Vector2( x, y ), content.Load<Texture2D>( "Textures/exitText" ), null ); entry.Selected += Exit; entry.TransitionOnPosition = entry.TransitionOffPosition = entry.Position + new Vector2( 0, ySpace * 5 ); entry.IdleScale = entryIdleScale * screenScale; entry.FocusScale = entryFocusScale * screenScale; MenuItems.Add( entry ); }
public PauseMenuScreen( ScreenManager screenManager ) { IsPopup = true; TransitionOnTime = TimeSpan.FromSeconds( .125 ); TransitionOffTime = TimeSpan.FromSeconds( .125 ); ScreenManager = screenManager; ContentManager content = screenManager.Game.Content; GraphicsDevice device = screenManager.GraphicsDevice; screenScale = (float)device.Viewport.Height / 1080f; // Background box Texture2D pauseBoxTexture = content.Load<Texture2D>( "Textures/pauseBox" ); Vector2 pauseBoxPosition = new Vector2( device.Viewport.Width / 2, device.Viewport.Height / 2 ); StaticImageMenuItem pauseBox = new StaticImageMenuItem( this, pauseBoxPosition, pauseBoxTexture ); pauseBox.TransitionOffPosition = pauseBoxPosition; pauseBox.TransitionOnPosition = pauseBoxPosition; pauseBox.SetImmediateScale( screenScale * 1.25f ); MenuItems.Add( pauseBox ); Vector2 transOnOffset = pauseBox.TransitionOnPosition - pauseBox.Position; Vector2 transOffOffset = pauseBox.TransitionOffPosition - pauseBox.Position; Vector2 entryPosition = pauseBoxPosition; Texture2D entryTexture; ImageMenuEntry entry; float entrySpacing = 45f; // Resume entry entryPosition += new Vector2( 0, -20 ) * screenScale; entryTexture = content.Load<Texture2D>( "Textures/resumeText" ); entry = new ImageMenuEntry( this, entryPosition, entryTexture, null ); entry.TransitionOffPosition = entryPosition + transOffOffset; entry.TransitionOnPosition = entryPosition + transOnOffset; entry.Selected += OnCancel; entry.FocusScale = entryFocusScale * screenScale; entry.IdleScale = entryIdleScale * screenScale; entry.Focused = true; MenuItems.Add( entry ); // Options entry optionsScreen = new OptionsMenuScreen( ScreenManager ); //optionsScreen.IsPopup = true; entryPosition += new Vector2( 0, entrySpacing ) * screenScale; entryTexture = content.Load<Texture2D>( "Textures/optionsText" ); entry = new ImageMenuEntry( this, entryPosition, entryTexture, null ); entry.TransitionOffPosition = entryPosition + transOffOffset; entry.TransitionOnPosition = entryPosition + transOnOffset; entry.Selected += OptionsMenuEntrySelected; entry.FocusScale = entryFocusScale * screenScale; entry.IdleScale = entryIdleScale * screenScale; MenuItems.Add( entry ); // Buy entry if ( Guide.IsTrialMode ) { entryPosition += new Vector2( 0, entrySpacing ) * screenScale; entryTexture = content.Load<Texture2D>( "Textures/buyText" ); entry = new ImageMenuEntry( this, entryPosition, entryTexture, null ); entry.TransitionOffPosition = entryPosition + transOffOffset; entry.TransitionOnPosition = entryPosition + transOnOffset; entry.Selected += GameCore.Instance.ShowBuy; entry.FocusScale = entryFocusScale * screenScale; entry.IdleScale = entryIdleScale * screenScale; MenuItems.Add( entry ); } // Restart entry entryPosition += new Vector2( 0, entrySpacing ) * screenScale; entryTexture = content.Load<Texture2D>( "Textures/restartText" ); entry = new ImageMenuEntry( this, entryPosition, entryTexture, null ); entry.TransitionOffPosition = entryPosition + transOffOffset; entry.TransitionOnPosition = entryPosition + transOnOffset; entry.Selected += RestartMenuEntrySelected; entry.FocusScale = entryFocusScale * screenScale; entry.IdleScale = entryIdleScale * screenScale; MenuItems.Add( entry ); // Exit entry entryPosition += new Vector2( 0, entrySpacing ) * screenScale; entryTexture = content.Load<Texture2D>( "Textures/exitText" ); entry = new ImageMenuEntry( this, entryPosition, entryTexture, null ); entry.TransitionOffPosition = entryPosition + transOffOffset; entry.TransitionOnPosition = entryPosition + transOnOffset; entry.Selected += ExitMenuEntrySelected; entry.FocusScale = entryFocusScale * screenScale; entry.IdleScale = entryIdleScale * screenScale; MenuItems.Add( entry ); }