Processing 3 환경에서 만든 미사일 피하기 게임입니다.
마우스 좌클릭: 탄환 발사
마우스 우클릭: 폭탄 사용
총알을 발사해서 적을 없애보세요.
폭탄을 이용해 시간을 잠시 벌어보세요.
void setup()
{
fullScreen();
}
int resolution_x=1680;
int resolution x=1050;
void setup()
{
fullScreen();
surface.setResizable(true);
surface.setSize(resolution_x, resolution_y);
}
int resolution_x=1680;
int resolution_y=1050;
void settings()
{
size(400,400);
}
void setup()
{
surface.setResizable(true);
surface.setSize(resolution_x, resolution_y);
}
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() |
PImage img;
void setup()
{
size(400,400);
img=loadImage("cursor_img.png");
}
void draw()
{
if (mouseX < 200)
cursor(CROSS);
else
cursor(img,8,8);
}
Name | cursor() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Examples | // Move the mouse left and right across the image // to see the cursor change from a cross to a hand void draw() { if (mouseX < 50) { cursor(CROSS); } else { cursor(HAND); } } | ||||||||
Description | Sets the cursor to a predefined symbol or an image, or makes it visible if already hidden. If you are trying to set an image as the cursor, the recommended size is 16x16 or 32x32 pixels. It is not possible to load an image as the cursor if you are exporting your program for the Web, and not all MODES work with all browsers. The values for parameters x and y must be less than the dimensions of the image. Setting or hiding the cursor does not generally work with "Present" mode (when running full-screen). With the P2D and P3D renderers, a generic set of cursors are used because the OpenGL renderer doesn't have access to the default cursor images for each platform (Issue 3791). | ||||||||
Syntax | cursor(kind) cursor(img) cursor(img, x, y) cursor() | ||||||||
Parameters |
| ||||||||
Returns | void | ||||||||
Related | noCursor() |
언어(language): 한국어
에디터 및 콘솔 폰트(editor and console font): 돋움체
PFont myFont;
void setup() {
size(400, 200);
// Uncomment the following two lines to see the available fonts
String[] fontList = PFont.list();
printArray(fontList);
myFont = createFont("한초롬바탕", 32);
textFont(myFont);
textAlign(CENTER, CENTER);
text(" 가나다라마바사아", width/2, height/2);
}
PFont myFont;
void setup() { }
size(400, 200);
// Uncomment the following two lines to see the available fontsc:windows\fonts 에 설치된 폰트 목록을 불러와서 콘솔창에 출력하기 위한 코드입니다.
String[] fontList = PFont.list();
printArray(fontList);
myFont = createFont("한초롬바탕", 32);PFont 자료형 myFont라는 이름의 변수에
textFont(myFont);다음 코드부터 출력되는 문자는
textAlign(CENTER, CENTER);다음 코드부터 출력되는 문자는 x, y 모두 가운대로 정렬되어 출력됩니다.
text(" 가나다라마바사아", width/2, height/2);문자열 "가나다라마바사아" 를