We are about to switch to a new forum software. Until then we have removed the registration on this forum.
My question maybe poorly worded, I just started teaching myself programming about a month ago or so, so you'll have to forgive me.
Basically I want to load multiple complex svg files and change the alphas of individual children within each svg without having to load each child separately. The following code I wrote as a simplified example of what I want to achieve just not how I'd like to achieve it. I think there might be an easier way to do this. Thanks.
PShape circle;
PShape tp;
PShape bm;
void setup(){
size(600,600);
background(#0066CC);
circle = loadShape("circle.svg");
tp = circle.getChild("top");
bm = circle.getChild("bottom");
tp.disableStyle();
fill(#000000, 100);
stroke(#995C1F);
shape(tp,0,0,width,height);
bm.disableStyle();
fill(#B2B247);
stroke(#995C1F);
shape(bm,0,0,width,height);
}
Answers
My two days of progress.
It's a good approach. With more complex SVGs, you can do it with an array and refer to the children by their positions within the array ([0], [1]) instead of their "name"