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

@@ -2,7 +2,7 @@

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

public class SecondApplet extends PApplet {
ControlP5 cp5;
@@ -45,6 +45,12 @@ public class SecondApplet extends PApplet {
.setSize(15, 15)
.plugTo(this, "CP5_pauseAllAction");
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")
@@ -60,6 +66,10 @@ public class SecondApplet extends PApplet {
binS = 40;
}

void CP5_nativeResoAction() {
renderSize = max(nativeResoX, nativeResoY);
//renderer.setSize(nativeResoX, nativeResoY);
}
void CP5_recordAction() {
recording = !recording;
}
@@ -92,6 +102,12 @@ public class SecondApplet extends PApplet {
totalBrickHeight+= bricks.get(i).h;
}
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);
noStroke();
rect(0, height-120, width, 120);

+ 3
- 0
source.pde View File

@@ -38,6 +38,9 @@ class SourceManager { //no constructor
void setImage(PImage img) { //set image to source
source = img.get();
fallbackImage = source;
nativeResoX = source.width;
nativeResoY = source.height;
println(nativeResoX);
}

void fallback() {

Loading…
Cancel
Save