fullscreen //text
PFont font;
PFont Designer;
PFont Write;
String letters = "";
//put a cursor on a rect
int x = 360;
int y = 360;
int w = 80;
int h = 80;
//mouse cursor image
float t = 0.0;
float u = 0.0;
float easing = 0.1;
void setup() {
size(600,600);
noCursor();
}
void draw() {
//basic ellipse
background(0);
stroke(0);
strokeWeight(0.5);
smooth();
for(int y = 0; y <= height; y += 80 + 20) {
for(int x = 0; x <= width; x += 80 + 20) {
fill(48,27,55);
noStroke();
ellipse(x,y,80,80);
}
}
//free text
font = loadFont("ahn2006-M-20.vlw");
textFont(font);
stroke(0);
fill(160);
text(letters, 450, 378, 130, 80);
if( keyPressed == true ) {
letters = letters + key;
}
//put a cursor on a rect
if((mouseX > x) && (mouseX < x + w) && (mouseY > y) && (mouseY < y+ h)) {
fill(255);
}
else {
fill(180,84,116);
}
rect(x, y, w, h);
//Designer text
fill(255);
PFont Designer;
Designer = loadFont("ahn2006-M-48.vlw");
textFont(Designer);
text("Designer", 220,420);
//write text
fill(160);
PFont Write;
Write = loadFont("ahn2006-M-20.vlw");
textFont(Write);
text("Write!!", 450,375);
//mouse cursor image
noStroke();
float targetT = mouseX;//c
float targetU = mouseY;
t += (targetT - t) * easing;
u += (targetU - u) * easing;
fill(48,27,55);
ellipse(mouseX,mouseY, 80,80);
}
Project 2.
색과 문자, 마우스효과등을 사용하여 Project1 변형하기
-
네모에 마우스를 가져다 대면 흰색으로 변합니다.
키보드를 치면 Write!! 밑에 글씨가 써집니다.
-
동그라미와 같은 모양의 마우스 커서는 유행바이러스입니다.
유행바이러스는 네모마저 동그라미와 같은 모양으로 전염시키려고 했으나,
네모는 흰색 빛을 내면서 유행바이러스를 튕겨냅니다.
꼭 직업이 디자이너가 아니더라도
자신만의 개성적인 생각을 가지고 있다면 누구든지 디자이너라고 생각합니다.
그래서 옆에 Write 밑에는 디자이너가 된 기분으로
글씨를 써 볼 수 있도록 빈 공간을 마련해두었습니다.