Ejemplo n.º 1
0
 public virtual void SetCurrentAnimation( Anim animation )
 {
     currentAnim = animation;
     currentAnimation = Animations[animation];
 }
Ejemplo n.º 2
0
        public override void Activate( bool instancePreserved )
        {
            if ( !instancePreserved )
            {
                ContentManager content = ScreenManager.Game.Content;

                banner = content.Load<Texture2D>( "Images/wizlogo3" );

                // Set up the Buttons
                Texture2D buttonTex = content.Load<Texture2D>( "UITextures/GUIButton" );
                SpriteFont buttonFont = content.Load<SpriteFont>( "Fonts/GUIFont" );

                // Single Player Button
                spButton = new Button( SP_BUTTON_POS, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT, this );
                spButton.Texture = buttonTex;
                spButton.SetFont( buttonFont,
                    BTNTEXT_INERT_COLOUR,
                    BTNTEXT_HOVER_COLOUR,
                    BTNTEXT_PRIMED_COLOUR,
                    BTNTEXT_INACTIVE_COLOUR );
                spButton.Text = "Single Player";
                spButton.RegisterCallback( spButton_OnClick );

                // Multiplayer Button
                mpButton = new Button( MP_BUTTON_POS, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT, this );
                mpButton.Texture = buttonTex;
                mpButton.SetFont( buttonFont,
                    BTNTEXT_INERT_COLOUR,
                    BTNTEXT_HOVER_COLOUR,
                    BTNTEXT_PRIMED_COLOUR,
                    BTNTEXT_INACTIVE_COLOUR );
                mpButton.Text = "Multiplayer";
                mpButton.RegisterCallback( mpButton_OnClick );

                // Options Button
                optionsButton = new Button( OPT_BUTTON_POS, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT, this );
                optionsButton.Texture = buttonTex;
                optionsButton.SetFont( buttonFont,
                    BTNTEXT_INERT_COLOUR,
                    BTNTEXT_HOVER_COLOUR,
                    BTNTEXT_PRIMED_COLOUR,
                    BTNTEXT_INACTIVE_COLOUR );
                optionsButton.Text = "Options";
                optionsButton.RegisterCallback( optionsButton_OnClick );

                // Achievements Button
                achiButton = new Button( ACHI_BUTTON_POS, STD_BUTTON_WIDTH, STD_BUTTON_HEIGHT, this );
                achiButton.Texture = buttonTex;
                achiButton.SetFont( buttonFont,
                    BTNTEXT_INERT_COLOUR,
                    BTNTEXT_HOVER_COLOUR,
                    BTNTEXT_PRIMED_COLOUR,
                    BTNTEXT_INACTIVE_COLOUR );
                achiButton.Text = "Achievements";
                achiButton.Active = false;
                achiButton.RegisterCallback( achiButton_OnClick );

                // Exit Button
                exitButton = new Button( EXIT_BUTTON_POS, EXIT_BUTTON_WIDTH, EXIT_BUTTON_HEIGHT, this );
                exitButton.Texture = buttonTex;
                exitButton.SetFont( buttonFont,
                    BTNTEXT_INERT_COLOUR,
                    BTNTEXT_HOVER_COLOUR,
                    BTNTEXT_PRIMED_COLOUR,
                    BTNTEXT_INACTIVE_COLOUR );
                exitButton.Text = "Exit";
                exitButton.RegisterCallback( exitButton_OnClick );

                altar1 = new Animation(new AnimationTexture(ScreenManager.Game.Content.Load<Texture2D>("Images/altar"), null), 3, 60, 1f, false);
                altar2 = new Animation(new AnimationTexture(ScreenManager.Game.Content.Load<Texture2D>("Images/altar"), null), 3, 60, 1f, false);

                // TODO: Delme (Demo Code)
                demoBGMusic = ScreenManager.Game.Content.Load<Song>( "Audio/Demo_FightingWinds" );
                MediaPlayer.IsRepeating = true;
                MediaPlayer.Play( demoBGMusic );
                MediaPlayer.Volume = 0.4f;
            }
        }