fullscreen background color setbackground & preferences doesn't work

edited January 2014 in How To...

Hi all,

I'm sorry I accidentally marked this question as answered: http://forum.processing.org/two/discussion/2573/fullscreen-background-color#Item_3 This is a summary of what I've done so far. So I'm exporting my sketch to an executable (Processing 2.1 on Windows 7). When I export to full screen mode the background colour is grey even though I've set it to white in my sketch. But I've tried both frame.setBackground(new java.awt.Color(255, 255, 255)); And change run.present.bgcolor=#666666 in my preferences.txt to #ffffff. The latter keeps reverting back to the default #666666.

I hope someone has another suggestion, my deadline is tomorrow. So any help is greatly appreciated. TIA, danielle.

Answers

  • edited January 2014 Answer ✓

    If you just want your sketch to cover the whole screen, set the size to size(displayWidth, displayHeight, yourRenderer); and add the following function to your code:

    boolean sketchFullScreen() {
        return true;
    }
    

    Or in case you want your canvas to be smaller than the JFrame, add the following function call to your setup() function:

    ((javax.swing.JFrame)frame).getContentPane().setBackground(java.awt.Color.white);
    
Sign In or Register to comment.