Ejemplo n.º 1
0
        WheelMenu wheel; // the parent wheel

        #endregion Fields

        #region Constructors

        public WheelMenuEntry( WheelMenu wheel, Texture2D texture )
        {
            this.wheel = wheel;
              this.texture = texture;

              segments = 10;

              extendedSpring = new SpringInterpolater( 1, 800, SpringInterpolater.GetCriticalDamping( 800 ) );
              extendedSpring.SetSource( 0 );
              extendedSpring.SetDest( 0 );
              extendedSpring.Active = true;

              growSpring = new SpringInterpolater( 1, 700, .25f * SpringInterpolater.GetCriticalDamping( 700 ) );
              growSpring.SetSource( 0 );
              growSpring.SetDest( 0 );
              growSpring.Active = true;

              float height = WheelMenu.EntryIdleSize;
              float width = height * (float)texture.Width / (float)texture.Height;
              GenerateVerts( width, height, segments, out idleVerts );
              GenerateVerts( width * WheelMenu.EntryActiveScale, height * WheelMenu.EntryActiveScale, segments, out activeVerts );

              vertexBuffer = new VertexPositionNormalTexture[( segments + 1 ) * 2];
              vertexDeclaration = new VertexDeclaration( wheel.Screen.ScreenManager.GraphicsDevice,
                                                 VertexPositionNormalTexture.VertexElements );
        }
Ejemplo n.º 2
0
        public override void LoadContent()
        {
            // load the fancy title effects
              LoadTitleContent();

              // create the wheel menu
              GraphicsDevice device = ScreenManager.GraphicsDevice;
              scale = (float)device.Viewport.Height / 1080f;

              ContentManager content = ScreenManager.Game.Content;

              Camera camera = new Camera( MathHelper.PiOver4, device.Viewport.AspectRatio,
                                  1f, 100f, new Vector3( 0, 3f, 10 ), new Vector3( 0, 3f, 0 ) );

              // this should prevent spikes in sign-in screen when creating first avatar
              new Avatar( AvatarDescription.CreateRandom(), AvatarAnimationPreset.Stand0,
                                                  1f, Vector3.UnitZ, Vector3.Zero );

              float wheelScale = 3f; // 2.5f old
              wheelMenu = new WheelMenu( this, camera, wheelScale, scale, -3, 0, 3, wheelScale / 2 );

              if ( Guide.IsTrialMode )
            WheelMenu.EntryActiveScale = 1.4f;
              else
            WheelMenu.EntryActiveScale = 1.75f;

              WheelMenuEntry entry;
              wheelMenu.AcceptingInput = false;

              entry = new WheelMenuEntry( wheelMenu, content.Load<Texture2D>( "Textures/playText" ) );
              entry.Selected += PlayMenuEntrySelected;
              wheelMenu.AddEntry( entry );

              if ( Guide.IsTrialMode )
              {
            entry = new WheelMenuEntry( wheelMenu, content.Load<Texture2D>( "Textures/buyText" ) );
            entry.Selected += GameCore.Instance.ShowBuy;
            entry.IsBuyOption = true;
            wheelMenu.AddEntry( entry );
              }

              entry = new WheelMenuEntry( wheelMenu, content.Load<Texture2D>( "Textures/howToPlayText" ) );
              entry.Selected += HowToPlayMenuEntrySelected;
              wheelMenu.AddEntry( entry );

              entry = new WheelMenuEntry( wheelMenu, content.Load<Texture2D>( "Textures/leaderboardText" ) );
              entry.Selected += LeaderboardMenuEntrySelected;
              wheelMenu.AddEntry( entry );

              entry = new WheelMenuEntry( wheelMenu, content.Load<Texture2D>( "Textures/optionsText" ) );
              entry.Selected += OptionsMenuEntrySelected;
              wheelMenu.AddEntry( entry );

              entry = new WheelMenuEntry( wheelMenu, content.Load<Texture2D>( "Textures/creditsText" ) );
              entry.Selected += CreditsMenuEntrySelected;
              wheelMenu.AddEntry( entry );

              entry = new WheelMenuEntry( wheelMenu, content.Load<Texture2D>( "Textures/exitText" ) );
              entry.Selected += OnCancel;
              wheelMenu.AddEntry( entry );

              MenuItems.Add( wheelMenu );

              signInMenuScreen = new SignInMenuScreen( ScreenManager );
              controlsMenuScreen = new ControlsMenuScreen( ScreenManager );
              optionsMenuScreen = new OptionsMenuScreen( ScreenManager );
              creditsMenuScreen = new CreditsMenuScreen( ScreenManager );
              highscoreScreen = new HighscoreScreen( ScreenManager );

              // pre-load other stuff here
              content.Load<Texture2D>( "Textures/messageBox" );
        }