Jump to content
  • Advertisement
Sign in to follow this  
Taylor Ringo

Testing my Screen Manager

This topic is 2023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I am learning to write a screen manager for XNA 4(To use for transitioning scenes). Though I cannot get the text to display so I can test the transition. I was watching the "XNA Platformer tutorial series #3" by codingmadeeasy on Youtube.

 

Here is my code when I draw the text in the splash screen:

 

 

 



    public class SplashScreen: GameScreen
    {
        KeyboardState keyState;
        SpriteFont font;

        public override void LoadContent(ContentManager Content)
        {
            base.LoadContent(Content);
            if (font == null)
                font = content.Load<SpriteFont>("FONT1");
        }
        public override void UnloadContent()
        {
            base.UnloadContent();
        }

        public override void Update(GameTime gametime)
        {
            keyState = Keyboard.GetState();
            if (keyState.IsKeyDown(Keys.Z))
                Screen_Manager.Instance.AddScreen(new TitleScreen());
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(font, "SplashScreen", new Vector2(100, 100), Color.Black);
        }
    }
}

 

Share this post


Link to post
Share on other sites
Advertisement

pop a breakpoint in Draw(...) see if it get hits, all look ok, i doubt you are calling it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!