Skip to content

Instantly share code, notes, and snippets.

@nacyot
Last active June 25, 2016 07:14
Show Gist options
  • Save nacyot/787487c216ee54a7c62b22dc3de6bfa5 to your computer and use it in GitHub Desktop.
Save nacyot/787487c216ee54a7c62b22dc3de6bfa5 to your computer and use it in GitHub Desktop.
// p5.js 한글 API
//
// http://codepen.io/nacyot/pen/Nrdjrd 에서 사용 가능
//
// 아래는 예제 코드
// 반드시,
// function setup(){
// //... 사이에 작성되어야함.
// }
//
// 캔버스생성(가로, 세로) = createCanvas
캔버스생성(300, 800);
//
// 클리어() = clear
// 배경(grayScale) = background
배경(255);
// 배경(red, green, blue, alpha) = background
배경(200, 0, 0);
// 채우기(grayScale) = fill
채우기(255);
// 채우기(red, green, blue, alpha) = fill
채우기(200, 0, 0);
// 채우기없음() = noFill
채우기기없음();
// 스트로크(grayScale) = stroke
스트로크(255);
// 스트로크(red, green, blue, alpha)
스트로크(200, 0, 0);
// 스트로크두께(두께) = strokeWeight
스트로크두께(10);
// 스트로크없음() = noStroke
스트로크없음();
//
// 점(x, y) = point
점(100, 100);
// 선(x1, y1, x2, y2) = point
선(100, 100, 500, 100);
// 타원(x, y, 가로, 세로) = ellipse
타원(150, 150, 100, 100);
// 직사각형(x, y, 가로, 세로) = rect
직사각형(150, 150, 100, 100);
// 사각형(x1, y1, x2, y2, x3, y3, x4, y4) = quad
사각형(50, 50, 250, 50, 300, 300, 50, 300);
// 삼각형(x1, y1, x2, y2, x3, y3) = triangle
삼각형(150, 50, 50, 300, 300, 300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment