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:
- xnappt_background.zip – the slides drawn over a 3D animated particle system. This requires either and Xbox, or a 3D card compatible with SM 3.0, which supports vertex textures
- xnappt_cornflowerblue.zip – the slides drawn over our favorite color. For those who can’t run the above project.
Pingback: 12 Months, 12 Samples » October Sample: ppt in XNA
Pingback: 12 Months, 12 Samples » 12 months, not quite 12 samples