fullScreen()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

fullScreen()

示例
 // Run the code at the full dimensions of the screen currently // selected inside the Preferences window 
int x = 0;



void setup()
{  
fullScreen();


background(0);


noStroke();


fill(102);


  } 
void draw()
{  
rect(x, height*0.2, 1, height*0.6);


 x = x + 2;


  } 

 // If more than one screen is attached to the computer, run the  // code at the full dimensions on the screen defined by the  // parameter to fullScreen() 
int x = 0;



void setup()
{  
fullScreen(2);


background(0);


noStroke();


fill(102);


  } 
void draw()
{  
rect(x, height*0.2, 1, height*0.6);


 x = x + 2;


  } 

 // Run full screen using the P2D renderer on screen 2 
int x = 0;



void setup()
{  
fullScreen(P2D, 2);


background(0);


noStroke();


fill(102);


  } 
void draw()
{  
rect(x, height*0.2, 1, height*0.6);


 x = x + 2;


  } 

 // If more than one screen is attached to the computer, run the  // code at the full dimensions across all of the attached screens 
int x = 0;



void setup()
{  
fullScreen(P2D, SPAN);


background(0);


noStroke();


fill(102);


  } 
void draw()
{  
rect(x, height*0.2, 1, height*0.6);


 x = x + 2;


  } 
描述 This function is new for Processing 3.0. It opens a sketch using the full size of the computer’s display. This function must be the first line in setup(). The size() and fullScreen() functions cannot both be used in the same program, just choose one.

When fullScreen() is used without a parameter, it draws the sketch to the screen currently selected inside the Preferences window. When it is used with a single parameter, this number defines the screen to display to program on (e.g. 1, 2, 3…). When used with two parameters, the first defines the renderer to use (e.g. P2D) and the second defines the screen. The SPAN parameter can be used in place of a screen number to draw the sketch as a full-screen window across all of the attached displays if there are more than one.

Prior to Processing 3.0, a full-screen program was defined with size(displayWidth, displayHeight).

语法
fullScreen() fullScreen(display) fullScreen(renderer) fullScreen(renderer, display)
参数
renderer String: the renderer to use, e.g. P2D, P3D, JAVA2D (default)
display int: the screen to run the sketch on (1, 2, 3, etc. or on multiple screens using SPAN)
返回值 void
相关 settings()
setup()
size()
smooth()

Updated on October 2, 2018 05:02:04pm EDT

fullScreen()