현재 처리 중을 사용하여 응용 프로그램을 작성 중입니다. 하위 요소를 선택하고 색상과 획을 조작 할 수있는 모양이 있지만 파일의 모든 요소를 크기를 조정할 수 없습니다. 기본적으로, 내가 원하는처럼 모든 일의 크기를 조정하는 것입니다처리시 pshape에서 하위 셰이프의 크기를 조정하는 방법
shape(shape, mouseX, mouseY, 600, 600);//parameters: shape, x-coor, y-coor, new width, new height;
하고, (바로 위의 라인처럼) 각 요소의 색상을 변경할 수 있습니다. 코드 :
PShape shape;
int noOfChilds;
/***************************************************************************/
void setup()
{
size(1000, 600);
shape = loadShape("a.svg");
noOfChilds = shape.getChildCount();
print(noOfChilds);
shapeMode(CENTER);
}
/***************************************************************************/
void draw()
{
background(100);
shape.enableStyle();
stroke(255);
shape(shape, mouseX, mouseY, 600, 600);
//
shape.disableStyle();
for(int i = 0; i < noOfChilds; i++)
{
pushMatrix();
translate(300, 300);
PShape ps = shape.getChild(i);
fill(random(255),random(255),random(255));
shape(ps, 0, 0);//shape(ps, 0, 0, anyValue, anyValue); seems to fail :'(
popMatrix();
}
}
/***************************************************************************/
다시 한 번 감사드립니다. Kevin :) – Zardoz