fullScreen()
프로세싱 3.0 버전에서 새로 나온 기능입니다.
화면을 풀스크린 상태로 만들어줍니다.
또한 여러개의 모니터를 사용하는 경우에도
메서드에 입력하는 숫자를 늘려가며 풀스크린 사용이 가능합니다.
여러개의 화면을 통합하여 출력할 경우에는 fullScreen(SPAN) 을 입력합니다.
setup() 안에 넣어 사용하면 별도의 과정 없이 사용자의 해상도에 맞게 풀스크린상태로
프로그램이 실행됩니다.
이 메서드는 3.0 이전 버전에서 사용되던 기존의 size() 와 동시에 사용이 불가능합니다.
예제 코드)
void setup()
{
fullScreen();
}
만약, 화면의 크기를 변경하고 싶다면
다음의 코드를 setup() 안에 추가해야 합니다.
surface.setResizable(true);
그 후
surface.setSize(x,y);
를 이용하여 유동적으로 화면 크기를 변경할 수 있습니다.
예제 코드)
int resolution_x=1680;
int resolution x=1050;
void setup()
{
fullScreen();
surface.setResizable(true);
surface.setSize(resolution_x, resolution_y);
}
단, 크기를 변경하여도 화면상단에 붙은 채로 크기만 변할 뿐 창모드로 변경이 불가능합니다.
예전의 방식대로 창모드에서 크기를 변환하고 싶다면 fullScreen() 대신 size()를 사용한 후 사용하면 됩니다. ( 3.0 버전 이후 size()를 사용할려면 setup() 이 아닌 settings()에 size()를 넣어 사용해야 합니다.)
예제 코드)
int resolution_x=1680;
int resolution_y=1050;
void settings()
{
size(400,400);
}
void setup()
{
surface.setResizable(true);
surface.setSize(resolution_x, resolution_y);
}
reference 원문
Name | fullScreen() | ||||
---|---|---|---|---|---|
Examples | // 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; } | ||||
Description | 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). | ||||
Syntax | fullScreen() fullScreen(display) fullScreen(renderer) fullScreen(renderer, display) | ||||
Parameters |
| ||||
Returns | void | ||||
Related | settings() setup() smooth() |
참조
https://github.com/processing/processing/wiki/Window-Size-and-Full-Screen-for-Processing-2.0
학습 목적으로 작성한 글이므로 자세하지 않거나 틀린 부분이 있을 수 있습니다.
자세한 정확한 정보는 원문을 보고 확인하시길 바랍니다.
댓글 없음:
댓글 쓰기