I'm not sure what the correct word for it is, but I'm thinking like the fading effects when you move between different screens in Powerpoint or Keynote; that the screen fades black before the new screen is shown instead of instantly change.

The "screens" I'm talking about are actually two pictures, and since it's for an adventure type game I thought it'd be cool if it could be done.

Does anyone know a good way to implement this?

  • 2
    \$\begingroup\$ You could probably just overlap a rectangle, fill it up with a color and just change scenery when the rectangle is fully faded in. \$\endgroup\$ – Sidar Jan 4 '14 at 7:01

The XNA Game State Management example project provides this exact function. It also handles loading screens, directing and halting input to the topmost screen, and some simple nested menu screens. You should probably check it out.

And to answer your question directly, it achieves the fading effect by drawing a full-screen black quad with a shifting alpha value. You could easily customize it by drawing your two pictures instead.

  • \$\begingroup\$ It's a pretty big project, could you do me an enormous favor and tell me only the parts of it I need to integrate it into a Game, without having seperate classes for each screen? \$\endgroup\$ – Neophyte Jan 4 '14 at 20:47
  • \$\begingroup\$ A screen management system can be really central to a complete game. It's not so much a thing you drop in as it is a thing you build the rest of the game into. So...no, I can't really do that. BUT! drawing the transition quad and fading it in and out is something you can do anywhere, any time. Just read through the project's code; you'll be glad you did. \$\endgroup\$ – Seth Battin Jan 4 '14 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.