Simple question: Can you set transparency on a .svg object loaded into a PShape when running P2D or P3D?
in
Programming Questions
•
1 month ago
Hi!
I cannot seem to set transparency on a loaded .svg in P2D or P3D. Can someone please verify if this is working for you:
Here is the sample code:
- PShape test;
- void setup()
- {
- size(1000,700,P2D);
- background(0);
- stroke(255);
- }
- void draw()
- {
- frameRate(30);
- stroke(255);
- strokeWeight(0);
- background(70, 20,10);
- test = loadShape("Guy_20130912.svg");
- test.disableStyle();
- fill(200,200,0,mouseX);
- test.setFill(20, 30);
- shape(test, 50,50);
- }
The test-svg can be downloaded here:
https://dl.dropboxusercontent.com/u/21219639/Guy_20130912.svg
If you change to size(1000,700) you will see that it is working. I cannot seem to set transparency using the .setFill on the PShapre either...
Anyhow any info on this would be much appreciated!
Thank you
1