Sketch not appearing full width

edited April 2014 in Using Processing

Not sure if this is something stupid on my end, but just brought my project over to a new display (older Samsung monitor with HDMI input, versus my standard Apple display) and when I run my sketch, despite my code (below) trying to render at full screen, it gets cut off at only filling about 1/2-2/3 of the monitor. Even when I've enabled resizing, it does not allow me to resize past this max-width. I've tried setting full screen via both standard 'size(displayWidth, displayheight)' and 'boolean sketchFullScreen()' methods, neither of which worked.

  void setup(){
    background(255);
    dWidth = displayWidth;
    dHeight = displayHeight;
    size(dWidth, dHeight);  // full screen
  }
Tagged:

Answers

  • How huge is this monitor?

  • I would test to see if the monitors resolution is being reported correctly. If it is, has Processing truncated it?

    void setup(){
      background(255);
      dWidth = displayWidth;
      dHeight = displayHeight;
      size(dWidth, dHeight);  // full screen
      println(dWidth + "  " + dHeight); // Reported size
      println(width + "  " +  height); // Sketch size, is it different from reported.
    }
    
  • quark, yes it is reading the screen res fine. that's what's even weirder. and the monitors (i've now tried two) are actually smaller than the original monitor i had built this on. they are 1920x1200 res. the final output is going to be displayed on a tv screen that is 65" though, so i need to be able to ensure that i can fill the screen no matter what size the output. the rest of the code is just looking for button presses and creating a bar graph, nothing that i can find or imagine would have any bearing on sketch size. kind of under the gun with time right now, so any and all suggestions and help is greatly appreciated.

  • for what it's worth, here's my full code (and i know there are a lot of redundancies that need to be cleaned up):

    import processing.serial.*;
    Serial myPort;
    
    int buttonVote1 = 0;
    int votes1 = 0;
    int buttonVote2 = 0;
    int votes2 = 0;
    int buttonVote3 = 0;
    int votes3 = 0;
    int buttonVote4 = 0;
    int votes4 = 0;
    int buttonVote5 = 0;
    int votes5 = 0;
    int buttonVote6 = 0;
    int votes6 = 0;
    
    int dWidth, dHeight;
    PImage logo, popup1, popup2, popup3, popup4, popup5, popup6, successImg;
    PFont font;
    int buttonPushed;
    String sessionVotes1, sessionVotes2, sessionVotes3, sessionVotes4, sessionVotes5, sessionVotes6;
    
    int time;
    int timeInterval = 350;
    int interval = 5000;
    boolean showPopup = false;
    
    color sess1 = color(229, 78, 51);
    color sess2 = color(64, 189, 133);
    color sess3 = color(239, 168, 2);
    color sess4 = color(40, 154, 164);
    color sess5 = color(134, 56, 142);
    color sess6 = color(102, 102, 102);
    color bgFlashColor;
    
    
    void setup(){
      background(255);
      dWidth = displayWidth;
      dHeight = displayHeight;
    
      size(dWidth, dHeight);  // full screen
      //size(1920, 1200);  // even hard coding in screen res is locking there sketch height and width to a max h & w
    
      font = createFont("Courier", 16, true);
      logo = loadImage("images/3x5_logo.png");
      popup1 = loadImage("images/session1.png");
      popup2 = loadImage("images/session2.png");
      popup3 = loadImage("images/session3.png");
      popup4 = loadImage("images/session4.png");
      popup5 = loadImage("images/session5.png");
      popup6 = loadImage("images/session6.png");
    
      //myPort = new Serial(this, "/dev/tty.usbmodem1411", 9600);  //macbook pro
      myPort = new Serial(this, "/dev/tty.usbmodem5d11", 9600);  // mac mini
    
    }
    
    void draw(){
    
      buttonPushed = myPort.read();
      print("myPort Read: ");
      println(buttonPushed);
    
      // draw bars
      int barStart = dHeight-110;
      int barWidth = 150;
      int incrementer = 20;
      int delayInt = 50;
    
      background(255);
    
      rect(75, barStart, barWidth, 1);
      rect(375, barStart, barWidth, 1);
      rect(675, barStart, barWidth, 1);
      rect(975, barStart, barWidth, 1);
      rect(1275, barStart, barWidth, 1);
      rect(1575, barStart, barWidth, 1);
    
      // vote session 1
      if(buttonPushed == 1){
        // vote success!
        time = timeInterval;
        successImg = popup1;
        bgFlashColor = sess1;
        showPopup = true;
    
        buttonVote1 = incrementer + buttonVote1++;
    
        // display votes
        sessionVotes1 = str(buttonVote1/incrementer);
        delay(delayInt);
      }
    
      // vote session 2
      if(buttonPushed == 2){
        // vote success!
        time = timeInterval;
        successImg = popup2;
        bgFlashColor = sess2;
        showPopup = true;
    
        buttonVote2 = incrementer + buttonVote2++;
    
        // display votes
        sessionVotes2 = str(buttonVote2/incrementer);
        delay(delayInt);
      }
    
      // vote session 3
      if(buttonPushed == 3){
        // vote success!
        time = timeInterval;
        successImg = popup3;
        bgFlashColor = sess3;
        showPopup = true;
    
        buttonVote3 = incrementer + buttonVote3++;
    
        // display votes
        sessionVotes3 = str(buttonVote3/incrementer);
        delay(delayInt);
      }
    
      // vote session 4
      if(buttonPushed == 4){
        // vote success!
        time = timeInterval;
        successImg = popup4;
        bgFlashColor = sess4;
        showPopup = true;
    
        buttonVote4 = incrementer + buttonVote4++;
    
        // display votes
        sessionVotes4 = str(buttonVote4/incrementer);
        delay(delayInt);
      }
    
      // vote session 5
      if(buttonPushed == 5){
        // vote success!
        time = timeInterval;
        successImg = popup5;
        bgFlashColor = sess5;
        showPopup = true;
    
        buttonVote5 = incrementer + buttonVote5++;
    
        // display votes
        sessionVotes5 = str(buttonVote5/incrementer);
        delay(delayInt);
      }
    
      // vote session 6
      if(buttonPushed == 6){
        // vote success!
        time = timeInterval;
        successImg = popup6;
        bgFlashColor = sess6;
        showPopup = true;
    
        buttonVote6 = incrementer + buttonVote6++;
    
        // display votes
        sessionVotes6 = str(buttonVote6/incrementer);
        delay(delayInt);
      }
    
      if(showPopup == true){
        time = time-10;
        print("time: ");
        println(time);
    
        if(time+25 > timeInterval){
          background(bgFlashColor); 
        } else {
          background(255);
        }
    
        if(time <= 255){
          print("t2: ");
          println(time);
          tint(255, time);
          image(successImg, (displayWidth/2)-((successImg.width*1.5)/2), (displayHeight/2)-((successImg.height*1.5)/2), successImg.width*1.5, successImg.height*1.5);
        } else {
          noTint();
          image(successImg, (displayWidth/2)-((successImg.width*1.5)/2), (displayHeight/2)-((successImg.height*1.5)/2), successImg.width*1.5, successImg.height*1.5);
        }
        if(time <= 0){
          showPopup = false;
          time = 0;
        }
      } else {
        time = 0;
      }
    
      noTint();
      image(logo, 25, 25, logo.width, logo.height);
    
      // draw labels
      int labelYPos = dHeight - 80;
      textFont(font, 22);
      textLeading(22);
      textAlign(CENTER);
      fill(0);
      text("Session1", 150, labelYPos);
      text("Session2", 450, labelYPos);
      text("Session3", 750, labelYPos);
      text("Session4", 1050, labelYPos);
      text("Session5", 1350, labelYPos);
      text("Session6", 1650, labelYPos);
    
      // draw bars
      stroke(0);
      fill(sess1);
      rect(75, barStart, barWidth, -(buttonVote1));
      fill(sess2);
      rect(375, barStart, barWidth, -(buttonVote2));
      fill(sess3);
      rect(675, barStart, barWidth, -(buttonVote3));
      fill(sess4);
      rect(975, barStart, barWidth, -(buttonVote4));
      fill(sess5);
      rect(1275, barStart, barWidth, -(buttonVote5));
      fill(sess6);
      rect(1575, barStart, barWidth, -(buttonVote6));
    
      // draw vote counts
      fill(0);
      if(sessionVotes1 != null){
        text(sessionVotes1, 145, (barStart-buttonVote1-5 )); 
      }
      if(sessionVotes2 != null){
        text(sessionVotes2, 445, (barStart-buttonVote2-5 )); 
      }
      if(sessionVotes3 != null){
        text(sessionVotes3, 745, (barStart-buttonVote3-5 )); 
      }
      if(sessionVotes4 != null){
        text(sessionVotes4, 1045, (barStart-buttonVote4-5 )); 
      }
      if(sessionVotes5 != null){
        text(sessionVotes5, 1345, (barStart-buttonVote5-5 )); 
      }
      if(sessionVotes6 != null){
        text(sessionVotes6, 1645, (barStart-buttonVote6-5 ));
      }
    }
    
  • Answer ✓

    so one detail i left out was that when the app was working full screen, it was running off my MacBook Pro. i moved everything over to an older Mac Mini. apparently that is the issue, as i retested with my MacBook connected to the new monitors and it works fine. so apparently there is a video card issue. one that i'm not going to deal with right now, but just in case anyone else runs into this in the future, check the video card on your machine.

Sign In or Register to comment.