Programming/Paper.js2013. 12. 3. 10:48

 

 

회전

 

<!DOCTYPE html>
<html>
<head>

 

<script type="text/javascript" src="paper-full.min.js"></script>


<script type="text/paperscript" canvas="myCanvas">


 var path = new Path.Rectangle(new Point(50, 50), new Size(100, 50));


 path.style = {
      fillColor: 'white',
      strokeColor: 'black'
 };

 

 var copy = path.clone();
 copy.strokeColor = 'red';

 copy.rotate(45);                       // 시계 방향으로 45도 회전

 
 var copy2 = path.clone();
 copy2.strokeColor = 'blue';

 copy2.rotate(-45);                   // 반시계 방향으로 45도 회전


</script>


</head>
<body>
     <canvas id="myCanvas" resize="true"></canvas>
</body>
</html>

 

예제 결과

 

 

 

 

'Programming > Paper.js' 카테고리의 다른 글

Paper.js 브러쉬 효과  (0) 2013.12.11
Paper.js 투명도 및 블랜딩 효과  (0) 2013.11.05
Paper.js 색상 및 스타일  (0) 2013.11.01
Paper.js 도형  (0) 2013.10.31
Paper.js 폴리곤 (Polygon)  (0) 2013.10.30
Posted by SiriusB