Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : choose your own adventure game with video transition

$
0
0


here



  1. class Page {
  2.   String bodyText; //string used for displaying the text
  3.   PImage backImg;
  4.   int[] options;
  5.   String nameMovie;
  6.   Page( String nameMovie_, String nameImage) {
  7.     //  bodyText = theString;
  8.     nameMovie = nameMovie_;
  9.     backImg = loadImage(nameImage);
  10.   }
  11.   void setBodyText(String theString) {// sets a string for the bodytext object
  12.     bodyText = theString;
  13.   }
  14.   void setOptions(int[] theOptions) {
  15.     options = new int[theOptions.length];
  16.     arrayCopy(theOptions, options);
  17.   }
  18.   void display() { //sets display option for text to be centered and have a buffer zone of 20 pixels.
  19.     image(backImg, 0, 0);
  20.     textAlign(CENTER);
  21.     fill(#03FF00);
  22.     text(bodyText, 20, 20, width-20, height-20);
  23.   }
  24.   void chooseOption(int theNum, int name) {
  25.     if (theNum < options.length) {
  26.       currentPage = options[theNum];
  27.     }
  28.   }
  29. }


Viewing all articles
Browse latest Browse all 1768

Trending Articles