2012-07-03 3 views
0

나는 다소 액션 스크립트 3에 익숙하지 않습니다. 플래시로 svg 내보내기/가져 오기를 작성 중이며 미리보기가 svg와 동일하게 동작해야합니다. 플래시에서 경로가 겹치면 제거됩니다. 어떻게 전체 영역을 채우게합니까?액션 스크립트 3 - 경로 겹침

경로로 생성이되어

object.graphics.moveTo(xpos[i], ypos[i]); 
object.graphics.lineTo(px, py); 

결과 enter image description here

답변

3

이는 권선 그래픽 경로에 의해 야기된다.

Flash에서 Defining winding rules
flash.diplay.GraphicsPathWinding

graphics-path-winding

, 기본 굴곡 규칙은 홀수이다. 편리한 방법을 사용하여 그려진 그래픽

import flash.display.GraphicsPathWinding; 

graphics.drawPath(new <int>[], new <Number>[], GraphicsPathWinding.NON_ZERO); 

lineTo(), drawCircle(), 또는 drawRect(), 당신은 beginFill()와 모양에 따라 endFill()이 같이 그려진 수 : drawPath를 사용하여 생산 그래픽

, 당신의 drawPath에 권선 GraphicsPathWinding.NON_ZERO를 추가 :

enter image description here

var g:Graphics = graphics; 

g.beginFill(0x123456) 
g.drawRect(100, 100, 50, 50); 
g.endFill(); 

g.beginFill(0x123456) 
g.drawRect(125, 125, 50, 50); 
g.endFill(); 
,451,515,

대신 :

even-odd

var g:Graphics = graphics; 

g.beginFill(0x123456) 
g.drawRect(100, 100, 50, 50); 
g.drawRect(125, 125, 50, 50); 
g.endFill(); 
+1

당신은 내가 아는 지식의 이상한하지만 가장 흥미로운 컬렉션이 있습니다. – Marty

+0

다음으로 돌아 가기 : beginFill, endill for lineto가 작동하지 않습니다. 문제의 중복은 하나의 연속적인 "lineto"의 결과입니다. (위의 그림을 참조하십시오.) lineto를 drawPath로 변환하려고합니다. – teynon