If you are presenting your Processing sketches to others, or you wish to move between different sketches
elegently, the SlideShow class can be used to create 'powerpoint' style presentations that
can include dynamic sketches.
To create a slide show you will need to import the multisketch package with the line
import org.gicentre.utils.multisketch.*;
For full details of the methods available see the Multisketch API documentation. See also, the SlideShowExample sketch supplied in the examples folder of the giCentre utilities library.
To create a slide show, you need to create a normal sketch that creates a set of slides in its setup() method and
then adds them to a SlideShow object. This sketch holding the entire slide show should not have a draw()
method since all the display is handled by the SlideShow. A minimal example is shown below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import org.gicentre.utils.multisketch.*; // Sketch to create a very simple slide show. void setup() { size(500,300); noLoop(); PFont font = createFont("serif",36); setLayout(new java.awt.GridLayout(1,1)); SlideShow show = new SlideShow(this); Slide slide = new Slide(font); slide.addLine("This is slide one"); show.addSlide(slide); slide = new Slide(font); slide.addLine("The final slide"); show.addSlide(slide); add(show); show.startShow(); } |
Line 10 ensures that the slide show occupies the full width and height of the sketch. The slideshow itself is initialised
in line 12 with a reference to the main sketch in which the slides will be displayed (almost always this).
Each slide is created with the default font used for displaying text (lines 14 and 18). Finally, the slide show is added
to the sketch (line 22) and started (line 23). Output in this example is a screen similar to the following,
Pressing the 'Page down' key (default keys are Page up and Page down to move forward and backward between slides), moves
to the second slide,
[TODO: Add dccumentation]. For the moment see the sketch SlideShowExample in the examples folder.
[TODO: Add dccumentation]. For the moment see the sketch SlideShowExample in the examples folder.
[TODO: Add dccumentation]. For the moment see the sketch SlideShowExample in the examples folder.