Browse Source

added scrollbar, added button to render in images native resolution

master
Victor Giers 2 years ago
parent
commit
d7bdf69a93
2 changed files with 20 additions and 1 deletions
  1. 17
    1
      secondapplet.pde
  2. 3
    0
      source.pde

+ 17
- 1
secondapplet.pde View File



PImage bin; PImage bin;
int maxSurfaceHeight = 500; int maxSurfaceHeight = 500;
int nativeResoX, nativeResoY;


public class SecondApplet extends PApplet { public class SecondApplet extends PApplet {
ControlP5 cp5; ControlP5 cp5;
.setSize(15, 15) .setSize(15, 15)
.plugTo(this, "CP5_pauseAllAction"); .plugTo(this, "CP5_pauseAllAction");
pauseAll.getCaptionLabel().getStyle().setMargin(-17, 0, 0, 20); pauseAll.getCaptionLabel().getStyle().setMargin(-17, 0, 0, 20);
Bang nativeReso = cp5.addBang("native reso")
.setPosition(220,height-35)
.setSize(15,15)
.plugTo(this, "CP5_nativeResoAction");
//nativeReso.getCaptionLabel().getStyle().setMargin(-17,0,0,20);


/* /*
Toggle saveParams = cp5.addToggle("save parameters") Toggle saveParams = cp5.addToggle("save parameters")
binS = 40; binS = 40;
} }


void CP5_nativeResoAction() {
renderSize = max(nativeResoX, nativeResoY);
//renderer.setSize(nativeResoX, nativeResoY);
}
void CP5_recordAction() { void CP5_recordAction() {
recording = !recording; recording = !recording;
} }
totalBrickHeight+= bricks.get(i).h; totalBrickHeight+= bricks.get(i).h;
} }
popMatrix(); popMatrix();
if(heightOverLimit){
strokeWeight(3);
fill(255);
line(width-5,-scrollAmount+4,width-5,height-120+(maxSurfaceHeight-120-totalBrickHeight)-scrollAmount-4);
//-scrollAmount + (-1*(maxSurfaceHeight-120-totalBrickHeight)));
}
fill(68, 68, 68); fill(68, 68, 68);
noStroke(); noStroke();
rect(0, height-120, width, 120); rect(0, height-120, width, 120);

+ 3
- 0
source.pde View File

void setImage(PImage img) { //set image to source void setImage(PImage img) { //set image to source
source = img.get(); source = img.get();
fallbackImage = source; fallbackImage = source;
nativeResoX = source.width;
nativeResoY = source.height;
println(nativeResoX);
} }


void fallback() { void fallback() {

Loading…
Cancel
Save