Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage obrazek;
- float q = 0;
- int value=0;
- int step=5;
- boolean inc=true;
- void setup() {
- size(750, 500);
- background(0);
- obrazek = loadImage ("smutnypan.jpg");
- }
- void draw() {
- background(0);
- //imageMode (CENTER);
- image (obrazek, (375), (250), 325, 250);
- if(mouseX > 375 & mouseX < 375+325 & mouseY >250 & mouseY < 250+250 ) {
- fill(value,0,0);
- if(inc)value+=step;
- else value-=step;
- if(value>250)
- {
- inc=false;
- value=250;
- }
- if(value<0){
- inc=true;
- value=0;
- }
- } else {
- fill(0,127,0);
- }
- ellipse(mouseX, mouseY, 30, 30);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement