0
\$\begingroup\$

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?

\$\endgroup\$
1
  • 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, 2014 at 7:01

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\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, 2014 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\$ Jan 4, 2014 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .