public FAQScreen( ScreenManager screenManager ) { ScreenManager = screenManager; IsPopup = true; TransitionOnTime = TimeSpan.FromSeconds( .25 ); TransitionOffTime = TimeSpan.FromSeconds( .25 ); faqText = "Q: Why don't I see any scores but mine?\n" + "A: It is possible no one is playing the game at the same time as you.\n" + " Avatar Hamster Panic cannot use Leaderboards and must share your scores\n" + " with people playing the game at the same time as you. The best scores of\n" + " others are shared and saved to your hard drive automatically for you.\n\n" + "Q: I'm playing at the same time with my friend but I don't see his/her scores.\n" + "A: Be patient. Because connections are done automatically, it may take some time\n" + " before you connect to your friends. It's also possible you are both having NAT\n" + " trouble. Please visit http://support.microsoft.com/kb/908880 for help in\n" + " resolving NAT issues.\n\n" + "Q: My friend's score didn't save when they signed in on a local profile.\n" + "A: Only Xbox LIVE members can save and share scores."; float ss = GameCore.Instance.GraphicsDevice.Viewport.Height / 1080f; ContentManager content = GameCore.Instance.Content; SpriteFont font = content.Load<SpriteFont>( "Fonts/FAQFont" ); Viewport viewport = GameCore.Instance.GraphicsDevice.Viewport; Vector2 center = new Vector2( viewport.Width / 2, viewport.Height / 2 - 30 * ss ); TextMenuItem item = new TextMenuItem( this, center, faqText, font ); item.TransitionOffPosition = center; item.TransitionOnPosition = center; item.Centered = true; item.Scale = ss; MenuItems.Add( item ); Rectangle safeRect = ScreenRects.SafeRegion; Vector2 backPos = new Vector2( safeRect.Left, safeRect.Bottom ); backPos.X = ( center.X - ss * item.Dimensions.X / 2 ); Texture2D backText = content.Load<Texture2D>( "Textures/bBackText" ); StaticImageMenuItem bBack = new StaticImageMenuItem( this, backPos, backText ); bBack.Origin.X = 0; bBack.SetImmediateScale( .5f * ss ); MenuItems.Add( bBack ); }
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 ); }
private LoadingScreen( ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad) { this.loadingIsSlow = loadingIsSlow; this.screensToLoad = screensToLoad; doneLoading = false; TransitionOnTime = TimeSpan.FromSeconds( 0.5 ); if ( loadingIsSlow ) { backgroundThread = new Thread( BackgroundWorkerThread ); backgroundThreadExit = new ManualResetEvent( false ); graphicsDevice = screenManager.GraphicsDevice; screenScale = graphicsDevice.Viewport.Height / 1080f; ContentManager content = GameCore.Instance.Content; howToPlay = new Texture2D[3]; for ( int i = 0; i < 3; ++i ) howToPlay[i] = content.Load<Texture2D>( "Textures/howtoplay" + ( i + 1 ).ToString() ); loadingText = content.Load<Texture2D>( "Textures/loadingText" ); pressStartText = content.Load<Texture2D>( "Textures/pressStartText" ); hamsterBall = content.Load<CustomModel>( "Models/hamsterBall" ); foreach ( CustomModel.ModelPart part in hamsterBall.ModelParts ) { part.Effect.CurrentTechnique = part.Effect.Techniques["DiffuseColor"]; part.EffectParamColor.SetValue( new Vector4( .8f, .7f, 1f, .5f ) ); part.Effect.Parameters["SpecularPower"].SetValue( 400 ); } Viewport viewport = screenManager.GraphicsDevice.Viewport; Vector2 viewportSize = new Vector2( viewport.Width, viewport.Height ); textPosition = new Vector2( viewportSize.X / 2, .93f * viewportSize.Y ); howToPlayScale = viewportSize.Y / 1080f; howToPlayPosition = viewportSize / 2; howToPlayOrigin = new Vector2( howToPlay[0].Width, howToPlay[0].Height ) / 2; } }
public ControlsMenuScreen( ScreenManager screenManager ) { ScreenManager = screenManager; ContentManager content = GameCore.Instance.Content; Texture2D background = content.Load<Texture2D>( "Textures/controls" ); StaticImageMenuItem item = new StaticImageMenuItem( this, Vector2.Zero, background ); Viewport viewport = GameCore.Instance.GraphicsDevice.Viewport; if ( viewport.AspectRatio < 16f / 9f ) { item.SetImmediateScale( (float)viewport.Height / (float)background.Height ); item.Origin.Y = 0; item.Origin.X = ( background.Width - background.Height * viewport.AspectRatio ) / 2; } else { item.SetImmediateScale( (float)viewport.Width / (float)background.Width ); item.Origin.X = 0; item.Origin.Y = ( background.Height - background.Width / viewport.AspectRatio ) / 2; } MenuItems.Add( item ); }
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 ); }
public HighscoreScreen( ScreenManager screenManager ) { TransitionOnTime = TimeSpan.FromSeconds( .25f ); TransitionOffTime = TimeSpan.FromSeconds( .25f ); IsPopup = true; leaderBoardTypeIndex = 1; leaderBoardTypes.Add( LeaderBoardType.Local ); leaderBoardTypes.Add( LeaderBoardType.Friend ); leaderBoardTypes.Add( LeaderBoardType.Global ); if ( HighscoreComponent.Global.Storage == null ) HighscoreComponent.Global.UserWantsToLoad = true; // load content ScreenManager = screenManager; ContentManager content = screenManager.Game.Content; defaultFont = content.Load<SpriteFont>( "Fonts/menufont" ); scoreFont = content.Load<SpriteFont>( "Fonts/scoreboardFont" ); barTexture = content.Load<Texture2D>( "Textures/playerScoreboardBar" ); arrowTexture = content.Load<Texture2D>( "Textures/arrow" ); Texture2D background = content.Load<Texture2D>( "Textures/menuBackground" ); Texture2D titleText = content.Load<Texture2D>( "Textures/highScoresTitleText" ); Texture2D filterText = content.Load<Texture2D>( "Textures/xChangeFilterText" ); Texture2D viewFAQText = content.Load<Texture2D>( "Textures/yFAQText" ); // static items StaticImageMenuItem item; Vector2 position; Viewport viewport = screenManager.GraphicsDevice.Viewport; Rectangle safeArea = viewport.TitleSafeArea; ss = viewport.Height / 1080f; float textScale = ss * .5f; // background item = new StaticImageMenuItem( this, Vector2.Zero, background ); if ( viewport.AspectRatio < 16f / 9f ) { item.SetImmediateScale( (float)viewport.Height / (float)background.Height ); item.Origin.Y = 0; item.Origin.X = ( background.Width - background.Height * viewport.AspectRatio ) / 2; } else { item.SetImmediateScale( (float)viewport.Width / (float)background.Width ); item.Origin.X = 0; item.Origin.Y = ( background.Height - background.Width / viewport.AspectRatio ) / 2; } MenuItems.Add( item ); // title position = new Vector2( safeArea.Center.X, safeArea.Top ); item = new StaticImageMenuItem( this, position, titleText ); item.SetImmediateScale( ss ); item.Origin.Y = 0; MenuItems.Add( item ); // change filter position = new Vector2( safeArea.X, safeArea.Bottom - viewFAQText.Height * textScale ); item = new StaticImageMenuItem( this, position, filterText ); item.Origin = new Vector2( 0, filterText.Height ); item.SetImmediateScale( textScale ); MenuItems.Add( item ); // view FAQ position = new Vector2( safeArea.X, safeArea.Bottom ); item = new StaticImageMenuItem( this, position, viewFAQText ); item.Origin = new Vector2( 0, viewFAQText.Height ); item.SetImmediateScale( textScale ); MenuItems.Add( item ); faqScreen = new FAQScreen( screenManager ); }
public GameCore() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager( this ); PlayerWins = new Dictionary<uint, int>( 4 ); PlayerColors = new Color[4] { new Color( 10, 100, 220 ), new Color( 200, 31, 7 ), new Color( 240, 180, 0 ), new Color( 80, 200, 10 ), }; graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8; IsFixedTimeStep = false; graphics.SynchronizeWithVerticalRetrace = true; AudioManager = new AudioManager( this ); Components.Add( AudioManager ); // Create the screen manager component. screenManager = new ScreenManager( this ); Components.Add( screenManager ); HighscoreComponent highscoreComponent = new HighscoreComponent( this, null, "Avatar Hamster Panic" ); HighscoreComponent.Global = highscoreComponent; Components.Add( highscoreComponent ); // Activate the first screens. //screenManager.AddScreen( new BackgroundScreen(), null ); //screenManager.AddScreen( new MainMenuScreen(), null ); DisplayGamertags = true; ShareHighScores = true; SoundEffectsVolume = 1f; MusicVolume = 1f; // Avatars require GamerServices Components.Add( new GamerServicesComponent( this ) ); Rumble = new RumbleComponent( this ); Components.Add( Rumble ); Instance = this; // Debugging components DebugManager = new DebugManager( this ); DebugManager.DrawOrder = 200; Components.Add( DebugManager ); DebugCommand = new DebugCommandUI( this ); DebugCommand.DrawOrder = 200; Components.Add( DebugCommand ); FpsCounter = new FpsCounter( this ); FpsCounter.DrawOrder = 200; Components.Add( FpsCounter ); TimeRuler = new TimeRuler( this ); TimeRuler.DrawOrder = 200; Components.Add( TimeRuler ); }
float ss; // screen scale #endregion Fields #region Constructors /// <summary> /// Constructor. /// </summary> public OptionsMenuScreen( ScreenManager screenManager ) { ScreenManager = screenManager; // Create our menu entries. Rectangle screenRect = ScreenRects.FourByThree; Vector2 entryPosition = new Vector2( screenRect.Center.X, screenRect.Center.Y ); Vector2 entryStep = new Vector2( 0, 50 ); ss = ScreenManager.Game.GraphicsDevice.Viewport.Height / 1080f; ContentManager content = ScreenManager.Game.Content; Vector2 position; // OPTIONS title Texture2D titleTexture = content.Load<Texture2D>( "Textures/optionsTitleText" ); position = new Vector2( 80, 80 ) * ss; StaticImageMenuItem title = new StaticImageMenuItem( this, position, titleTexture ); title.SetImmediateScale( ss ); title.Origin = Vector2.Zero; title.TransitionOnPosition = position - new Vector2( 0, 200 ) * ss; title.TransitionOffPosition = position - new Vector2( 0, 200 ) * ss; MenuItems.Add( title ); MenuEntry entry; position = new Vector2( 100, 260 ) * ss; float entrySpacing = 50 * ss; float leftEdge = position.X + 520 * ss; // Sound Effects Volume: [------] entry = new MenuEntry( this, position, "Sound Effects Volume: " ); entry.Focused = true; entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( entry ); float soundVolume = GameCore.Instance.SoundEffectsVolume; Vector2 sliderPos = new Vector2( leftEdge, position.Y ); SliderMenuItem soundSlider = new SliderMenuItem( this, sliderPos, soundVolume ); soundSlider.TransitionOnPosition = entry.TransitionOnPosition + new Vector2( leftEdge - position.X, 0 ); soundSlider.TransitionOffPosition = entry.TransitionOffPosition + new Vector2( leftEdge - position.X, 0 ); soundSlider.ValueChanged += ( () => { GameCore.Instance.SoundEffectsVolume = soundSlider.Value; GameCore.Instance.AudioManager.Play2DCue( "laserShot", 1f ); //GameCore.Instance.AudioManager.Play2DCue( "plasticHit", 1f ); } ); MenuItems.Add( soundSlider ); entry.Decremented += ( ( o, args ) => soundSlider.Value -= .1f ); entry.Incremented += ( ( o, args ) => soundSlider.Value += .1f ); position.Y += entrySpacing; // Music Volume: [------] entry = new MenuEntry( this, position, "Music Volume: " ); entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( entry ); float musicVolume = GameCore.Instance.MusicVolume; sliderPos = new Vector2( leftEdge, position.Y ); SliderMenuItem musicSlider = new SliderMenuItem( this, sliderPos, musicVolume ); musicSlider.TransitionOnPosition = entry.TransitionOnPosition + new Vector2( leftEdge - position.X, 0 ); musicSlider.TransitionOffPosition = entry.TransitionOffPosition + new Vector2( leftEdge - position.X, 0 ); musicSlider.ValueChanged += ( () => { GameCore.Instance.MusicVolume = musicSlider.Value; //GameCore.Instance.AudioManager.Play2DCue( "selectItem", 1f ); } ); MenuItems.Add( musicSlider ); entry.Decremented += ( ( o, args ) => musicSlider.Value -= .1f ); entry.Incremented += ( ( o, args ) => musicSlider.Value += .1f ); position.Y += entrySpacing; // Display Gamertags: YES/NO entry = new MenuEntry( this, position, "Display Gamertags: " ); entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( entry ); bool displayTags = GameCore.Instance.DisplayGamertags; Vector2 tagBoolPos = new Vector2( leftEdge, position.Y ); BooleanMenuItem tagBool = new BooleanMenuItem( this, tagBoolPos, displayTags ); tagBool.Scale = ss; tagBool.TransitionOnPosition = entry.TransitionOnPosition + new Vector2( leftEdge - position.X, 0 ); tagBool.TransitionOffPosition = entry.TransitionOffPosition + new Vector2( leftEdge - position.X, 0 ); tagBool.ValueChanged += ( () => { GameCore.Instance.DisplayGamertags = tagBool.Value; GameCore.Instance.AudioManager.Play2DCue( "selectItem", 1f ); } ); MenuItems.Add( tagBool ); EventHandler<PlayerIndexEventArgs> toggleTags = ( ( o, args ) => { tagBool.Value = !tagBool.Value; } ); entry.Selected += toggleTags; entry.Incremented += toggleTags; entry.Decremented += toggleTags; position.Y += entrySpacing; // Enable Controller Rumble: YES/NO entry = new MenuEntry( this, position, "Enable Controller Rumble: " ); entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( entry ); bool enableRumble = GameCore.Instance.Rumble.Enabled; Vector2 rumbleBoolPos = new Vector2( leftEdge, position.Y ); BooleanMenuItem rumbleBool = new BooleanMenuItem( this, rumbleBoolPos, enableRumble ); rumbleBool.Scale = ss; rumbleBool.TransitionOnPosition = entry.TransitionOnPosition + new Vector2( leftEdge - position.X, 0 ); rumbleBool.TransitionOffPosition = entry.TransitionOffPosition + new Vector2( leftEdge - position.X, 0 ); rumbleBool.ValueChanged += ( () => { GameCore.Instance.Rumble.Enabled = rumbleBool.Value; GameCore.Instance.AudioManager.Play2DCue( "selectItem", 1f ); } ); MenuItems.Add( rumbleBool ); EventHandler<PlayerIndexEventArgs> toggleRumble = ( ( o, args ) => { rumbleBool.Value = !rumbleBool.Value; } ); entry.Selected += toggleRumble; entry.Incremented += toggleRumble; entry.Decremented += toggleRumble; position.Y += entrySpacing; // Share Highscores entry = new MenuEntry( this, position, "Share High Scores" ); entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( entry ); bool shareScores = GameCore.Instance.ShareHighScores; Vector2 shareBoolPos = new Vector2( leftEdge, position.Y ); BooleanMenuItem shareBool = new BooleanMenuItem( this, shareBoolPos, shareScores ); shareBool.Scale = ss; shareBool.TransitionOnPosition = entry.TransitionOnPosition + new Vector2( leftEdge - position.X, 0 ); shareBool.TransitionOffPosition = entry.TransitionOffPosition + new Vector2( leftEdge - position.X, 0 ); shareBool.ValueChanged += ( () => { GameCore.Instance.ShareHighScores = shareBool.Value; GameCore.Instance.AudioManager.Play2DCue( "selectItem", 1f ); } ); MenuItems.Add( shareBool ); EventHandler<PlayerIndexEventArgs> toggleShare = ( ( o, args ) => { shareBool.Value = !shareBool.Value; } ); entry.Selected += toggleShare; entry.Incremented += toggleShare; entry.Decremented += toggleShare; position.Y += entrySpacing; // Clear Highscores entry = new MenuEntry( this, position, "Clear High Scores" ); entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( entry ); entry.Selected += ( ( o, args ) => { HighscoreComponent.Global.ClearHighscores(); } ); position.Y += entrySpacing; // Restore Defaults entry = new MenuEntry( this, position, "Restore Defaults" ); entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( entry ); position.Y += entrySpacing; entry.Selected += ( ( o, args ) => { soundSlider.Value = 1f; musicSlider.Value = 1f; tagBool.Value = true; rumbleBool.Value = true; shareBool.Value = true; } ); // Back entry = new MenuEntry( this, position, "Back" ); entry.Scale = ss; entry.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; entry.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; entry.Selected += OnCancel; MenuItems.Add( entry ); }
public static void Load( ScreenManager screenManager, bool loadingIsSlow, PlayerIndex? controllingPlayer, params GameScreen[] screensToLoad) { foreach ( GameScreen screen in screenManager.GetScreens() ) screen.ExitScreen(); LoadingScreen loadingScreen = new LoadingScreen( screenManager, loadingIsSlow, screensToLoad ); screenManager.AddScreen( loadingScreen, controllingPlayer ); }
float ss; // screen scale #endregion Fields #region Constructors public CreditsMenuScreen( ScreenManager screenManager ) { ScreenManager = screenManager; ContentManager content = screenManager.Game.Content; ss = screenManager.Game.GraphicsDevice.Viewport.Height / 1080f; float scale = ss; TextMenuItem item; Vector2 position; string names; SpriteFont font = content.Load<SpriteFont>( "Fonts/menufont" ); Color headingColor = new Color( 255, 255, 100 ); Color nameColor = new Color( 225, 225, 225 ); // CREDITS title position = new Vector2( 80, 80 ) * ss; Texture2D image = content.Load<Texture2D>( "Textures/creditsTitleText" ); StaticImageMenuItem title = new StaticImageMenuItem( this, position, image ); title.Origin = Vector2.Zero; title.SetImmediateScale( scale ); title.TransitionOnPosition = position - new Vector2( 0, 100 ) * ss; title.TransitionOffPosition = position - new Vector2( 0, 100 ) * ss; MenuItems.Add( title ); // artwork position = new Vector2( 100, 220 ) * ss; item = new TextMenuItem( this, position, "Artwork", font ); item.Scale = scale; item.Color = headingColor; item.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; item.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( item ); position = new Vector2( 100, 260 ) * ss; names = "Sabrina Sullivan\nBryce Garrison\nKristine Serio"; item = new TextMenuItem( this, position, names, font ); item.Scale = scale; item.Color = nameColor; item.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; item.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( item ); // programming position = new Vector2( 100, 440 ) * ss; item = new TextMenuItem( this, position, "Programming", font ); item.Scale = scale; item.Color = headingColor; item.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; item.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( item ); position = new Vector2( 100, 480 ) * ss; names = "Alex Serio"; item = new TextMenuItem( this, position, names, font ); item.Scale = scale; item.Color = nameColor; item.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; item.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( item ); // special thanks position = new Vector2( 100, 600 ) * ss; item = new TextMenuItem( this, position, "Special Thanks", font ); item.Scale = scale; item.Color = headingColor; item.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; item.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( item ); position = new Vector2( 100, 640 ) * ss; names = "Jace Sangco\nPaul Flores\nRoy Flores"; item = new TextMenuItem( this, position, names, font ); item.Scale = scale; item.Color = nameColor; item.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; item.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; MenuItems.Add( item ); //// sound effects //position = new Vector2( 100, 900 ) * ss; //string text = "Most sound effects from soundsnap.com.\nHigh Score component by Jon Watte."; //item = new TextMenuItem( this, position, text, font ); //item.TransitionOnPosition = position - new Vector2( 200, 0 ) * ss; //item.TransitionOffPosition = position - new Vector2( 200, 0 ) * ss; //item.Scale = .85f * scale; //MenuItems.Add( item ); }