how to change background color of present mode and remove graphical stop option?

edited October 2014 in How To...

i need to run my sketch in present mode CTRL+SHIFT+R best size for my sketch is size(768,576); on projection screen i got useless space in gray color and stop option to with mouse

how to change that gray color to black and not display the stop option?

please help

Answers

  • ok, quick fix was setting run.present.bgcolor=#000000 run.present.stop.color=#000000

    in preferences file

    is there a way to send this info from sketch and not modify the global preferences file?

  • edited October 2014

    How about controlling sketch's instantiation itself. And passing arguments to it: :bz

    /**
     * PApplet Parameters (v1.1)
     * by GoToLoop (2014/Oct)
     *
     * forum.processing.org/two/discussion/7519/
     * how-to-change-background-color-of-present-mode-
     * and-remove-graphical-stop-option
     */
    
    static final void
    main(String[] args) {
      String sketch = Thread.currentThread()
        .getStackTrace()[1].getClassName();
    
      PApplet.main(joinArgs(sketch, args
        , "--full-screen"
        , "--hide-stop"
        , "--bgcolor=#000000"
        , "--stop-color=#000000"
        ));
    }
    
    static final String[]
    joinArgs(String name, String[] oldArgs, String... newArgs) {
      return concat(append(newArgs, name), oldArgs);
    }
    
    void setup() {
      size(displayWidth, displayHeight, JAVA2D);
      smooth(4);
      noLoop();
      frameRate(10);
    
      textSize(0200);
      textAlign(CENTER, CENTER);
    
      keyPressed();
      println(args);
    }
    
    void draw() {
      background(-1);
      text(width + " x " + height, width>>1, height>>1);
    }
    
    void keyPressed() {
      fill((color) random(#000000));
      redraw();
    }
    
    void mousePressed() {
      keyPressed();
    }
    

    Indeed both main() & joinArgs() are sore boilerplates! We can move both to another tab btW! ;)

  • edited October 2014

    Another slightly tweaked new version: <):)
    https://github.com/processing/processing/pull/2895

    /**
     * PApplet Parameters (v1.2)
     * by GoToLoop (2014/Oct)
     *
     * forum.processing.org/two/discussion/7519/
     * how-to-change-background-color-of-present-mode-
     * and-remove-graphical-stop-option
     */
    
    static final void
    main(String[] args) {
      String sketch = Thread.currentThread()
        .getStackTrace()[1].getClassName();
    
      main(sketch, args
        , "--full-screen"
        , "--hide-stop"
        , "--bgcolor=#000000"
        , "--stop-color=#000000"
        );
    }
    
    static final void
    main(String name, String[] oldArgs, String... newArgs) {
      runSketch(concat(append(newArgs, name), oldArgs), null);
    }
    
    void setup() {
      size(displayWidth, displayHeight, JAVA2D);
      smooth(4);
      noLoop();
      frameRate(10);
    
      textSize(0200);
      textAlign(CENTER, CENTER);
    
      keyPressed();
      println(args);
    }
    
    void draw() {
      background(-1);
      text(width + " x " + height, width>>1, height>>1);
    }
    
    void keyPressed() {
      fill((color) random(#000000));
      redraw();
    }
    
    void mousePressed() {
      keyPressed();
    }
    
Sign In or Register to comment.