We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I do not know if this should go under "Questions about Code" or "Libraries" Are the setFill() and/or setTint() functionalities working within PShape. I am trying to use wither of the capabilities in the code below and seeing no changes. Am I missing something in my code? Does anybody have any code that uses this functionality? Thanks for all of the help.
void settrans(int trans) {
println("Setting TRANSPARENCY to "+trans+" *********************************");
int braincells = brain.getChildCount();
for (int cellnum = 0; cellnum < braincells; ++cellnum) {
tempcell= brain.getChild(cellnum);
for (int j = 0; j<6; j++) {
tempface=tempcell.getChild(j);
//tempface.setFill(quadBG[j]);
tempface.setTint(trans);
}}
shape(brain);} // Draw the brain
My tracing when I make the calls is : Setting TRANSPARENCY to 255 ********************************* Setting TRANSPARENCY to 88 ********************************* Setting TRANSPARENCY to 255 ********************************* Setting TRANSPARENCY to 88 *********************************
Answers
Updated code and removed questions that are no longer needed. Any help would be appreciated.
I am also having this issue and am unable to figure it out. However, I do have a work around. Not sure if this solves your problem, but, it might get you closer to your goal.
It's possible to not use the shape's style methods doing the following,
Hope this helps. Will post back here if I find a solution.
I was never able to set the alpha/transparency, so I did the following work around. I created 2 arrays of colors, one with alpha=255 and another with alpha=88, then used the code below:
hi, I would like to bump this thread. I cant find a way to get setFill() working either.
did you read the tutorial?
i don't know about alpha, but setfill works, just use it with color explicitly.
I am sorry that I do not understand your solution.
When you say use the color explicitly, what do you mean? quadBG and qadBGtinted are two different arrays with the color for the background, with tinted having a different alpha value. How do I do this using the color explicitly? Thanks for the help.