This sample might be considered strange…
The sample shows a content pipeline extension that allows you to add PowerPoint presentations (.ppt) in your game, and display them as a slide-show inside your XNA application.
The Power Point Importer and processor take care of transforming a .ppt file into a series of images that can then be loaded as textures. The output of this processor is a class named XNAPowerPointShow, which holds the collection of textures accessible at runtime.
The Power Point Processor also accepts two parameters. These parameters specify which solid color to be used as a background, and how opaque the background is supposed to be at runtime.
A few notes:
- when building the content, some .png files will be created in your Content folder, for each slide in the PowerPoint file. These are build by the processor, and then referenced, in order to be transformed into textures by the content pipeline. These should be removed after the build operation is done, but I’m not sure how to do that, or if it will interfere with the rest of the Content build process
- The processor uses some COM components belonging to Microsoft Office 2007, so you need to have this installed in order to build the sample
- It is recommended that the .ppt file has a solid color as the background.
- I couldn’t test it on the Xbox for several reasons, but there shouldn’t be any problems.
To exemplify the coolness factor of this sample, I made a particle system run in the background of the slides. I used Mitch Walker’s Gamefest presentation for this. The results can be seen below:
To control the slides, you can use :
- Keyboard Right/PageDown; Gamepad A,DPadRight, Right Button to advance the slides
- Keyboard Left/PageUp; Gamepad B, DPadLeft, Left Button to go back to the previous slide
The sample is available below: