MovieWrap

class MovieWrap {
  String  moviePath;
  Movie   movie;
  PApplet applet;
  int     x,y,w,h;
  boolean visible;
  float   mSpeed = 1.0;

  MovieWrap(PApplet Applet, String Path) {
    applet = Applet;
    moviePath = Path;
    visible = true;
    movie = new Movie(applet,moviePath);
  }

  void setPosition(int X, int Y) {
    x = X;
    y = Y;
  }
  void setDimension() {
    movie.play();
    movie.jump(movie.duration());
    if(movie.available()) {
        movie.read();
    }
    movie.jump(0);
    w = movie.width;
    h = movie.height;
    movie.loop();
  }

  void draw() {
    //if(visible) {
      movie.speed(mSpeed);
      if(movie.available()) {
        movie.read();
      }
      image(movie,x,y);
    //}

   // println(x + " " + w);
  }

  void setSpeed(float Speed) {
    mSpeed = Speed;
  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>