Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Day2

Taeyoon Choi
August 20, 2016
420

 Day2

Taeyoon Choi

August 20, 2016
Tweet

Transcript

  1. ѐߊ ജ҃ ѐߊ ೒۽਋ 1.௏٘ ߸҃ 2.ࢲ࠳ۄ੐ীࢲ ੷੢ (Ctrl +

    S, Command + S) 3. ౵੉য಩झীࢲ ܻ೐ېद (Ctrl + R, Command + R) ࢲ࠶ۄ੐ ౵੉য಩झ
  2. function draw() { textAlign(CENTER); textSize(150); textStyle(BOLD); text(“OOF", windowWidth / 2,windowHeight

    / 2); } 윈도우 너비의 절반 윈도우의 높이의 절반 중심 스타일 “ 글 ”
  3. //Ҋ਷ |Ӓ Ԣ} function setup() { createCanvas(windowWidth, windowHeight); } function

    draw() { background(230,140,140,100); fill(255,255,255,100); textSize(50); text("ղ۰т ٸ ࠁও֎ ৢۄт ٸ ࠁ૑ ޅೠ Ӓ Ԣ", 150, windowHeight/2); } 코멘트 시 내용 Opacity(ైݺب): 1~100
  4. //Ҋ਷ |Ӓ Ԣ} function setup() { createCanvas(windowWidth, windowHeight); } function

    draw() { background(230,140,140); fill(255,255,255,100); textSize(50); text("ղ۰т ٸ ࠁও֎ ৢۄт ٸ ࠁ૑ ޅೠ Ӓ Ԣ", windowWidth / 2 - 200, windowHeight / 2, 300,300); } Bounding box
  5. //Ҋ਷ |Ӓ Ԣ} function setup() { createCanvas(windowWidth, windowHeight); } function

    draw() { background(230,140,140); fill(255,255,255,70); textSize(50); text("ղ۰т ٸ ࠁও֎ \nৢۄт ٸ ࠁ૑ ޅೠ \nӒ Ԣ, windowWidth / 2 - 200, windowHeight / 2, 600,300); } \ ੑ۱ ߑߨ: ׮਺ ठۄ੉٘ Opacity(ైݺب): 1~100 600 300
  6. function draw() { textAlign(CENTER); textSize(150); textStyle(BOLD); text("OOF", windowWidth / 2,

    windowHeight / 2); } 윈도우 너비의 절반 윈도우의 높이의 절반 글자 중앙정렬 글자의 스타일(굵게) “ 글 ”
  7. function draw() { background(0); fill(255); textSize(200); var ਘ = month();

    var ੌ = day(); var ֙ = year(); text(ਘ + “ ” + ੌ + “,” + ֙, 250, windowHeight/2); } 월 일 년 스페이스
  8. var द = hour(); var ࠙ = minute(); var ୡ

    = second(); text(द + " : " + ࠙ + " : " + ୡ, 250,windowHeight/2+100); 시 분 초 시계 만들기
  9. var ੑ۱ః = 0; function setup() { createCanvas(windowWidth, windowHeight); }

    function draw() { fill(230); noStroke(); rect(0, 0, width, height); fill(0); textSize(200); text(ੑ۱ః, width / 2, height / 2); } function keyTyped() { ੑ۱ః = key; } 변수 keyTyped 함수: 입력시 작동 key 값
  10. var ੑ۱ః = 0; function setup() { createCanvas(windowWidth, windowHeight); }

    function draw() { fill(230); noStroke(); rect(0, 0, width, height); fill(0); textSize(200); text(ੑ۱ః, width / 2, height / 2); } function keyTyped() { ੑ۱ః = key; } 변수 key 값 이것은 사각형 그리기. 이것은 왜 필요 할까요? 알아보기 위해 서 코드를 코멘 트 아웃 할까요? windowWidth
  11. < ୡҗ Greater than <= ੉࢚ Greater or equal >=

    ੉ೞ less or equal > ޷݅ less than == э׮ equal to != ׮ܰ׮ not equal to
  12. function draw() { background(255); fill(255); ellipse(windowWidth/2, windowHeight/2, 100, 100); if

    (mouseX > windowWidth/2) { fill(0); ellipse(windowWidth/2, windowHeight/2, 100, 100); } } 만약에 마우스 위치가 캔버스 크기의 절반보 다 크다면…
  13. function draw() { background(255); fill(255); ellipse(width/2, height/2, 100, 100); if

    (mouseX > windowWidth/2 || mouseY > windowHeight/ 2) { fill(0); ellipse(width/2, height/2, 100, 100); } } | 는 Or mouseX가 폭의 절반보다 크거나 , mouseY 가 높이 의 절반보다 크거 나