43
edits
Line 76: | Line 76: | ||
== Homework 3 == | == Homework 3 == | ||
<source lang="java"> | |||
PImage[] images = new PImage[19]; | |||
PImage alpha; | |||
int w=100; | |||
int h; | |||
void setup() { | |||
size(400, 500); | |||
frameRate(10); | |||
background(255); | |||
for (int i = 0 ; i < images.length; i++) | |||
{ | |||
images [i] = loadImage("IMG_0" + (701 + i) + ".JPG"); | |||
alpha = loadImage("alphamask.gif"); | |||
images [i].mask(alpha); | |||
images [i].resize(100, 100); | |||
println(i); | |||
} | |||
} | |||
void draw() | |||
{ | |||
if(mousePressed){ | |||
int counter = frameCount % 19; | |||
image(images[counter], mouseX - 50, mouseY - 50); | |||
} | |||
} | |||
</source> | |||
http://cdn.makeagif.com/media/1-12-2016/Cv_-WL.gif |
edits