I want to draw as part of an experiment a transparent rectangle as a stimuli on the screen. When I run the experiment offline, everything works. But online the following error occurs: “ ReferenceError: None is not defined ”
I think the problem is the “None” in this part of my code:
Thank you very much, but I think I should describe my experiment in more detail: I try to develop an adapted version of the stroop task. I already set the opacity of the rectangles, because in some trials they should appear and sometimes not. But now I want to make the filling colour transparent and this does not work in the online version (offline it works pretty well!).
I am sorry for the confusion!
You could always set the fill color to the background color to appear transparent, and that way this color can be stated in the conditions file. Then, its just a question of changing the shape color on each trial.
If you use “None” as your color (not ‘$None’), then PsychoPy will convert it to undefined for you, and you will no longer have your error. Adding the extra dollar sign interferes with the conversion process, so needs to be fixed.
You should really just try setting the fill color the same as the background. You will keep your outline, but the shape will look unfilled because the color is the same as the background. Try adding $[0,0,0] in place of None.
I could not set the fill color the same as the background, because the rectangles should be drawn around some words of the stroop task (to mark task switching). Anyway, I found a solution for my problem: I used a transparent image of an rectangle and now my experiment works.
Hi everyone, for people wanting to create transparent shapes for use on Pavlovia that have a non-transparent outline, I’ve found it’s really easy to do by creating a transparent shape in Powerpoint.
Draw your shape in Powerpoint with the border color/weight that you’d like. Then, right click the shape >> ‘Format shape’ >> ‘Fill’ to ‘Solid fill’ and slide the Transparency slider to 100%.
Then, right click the background >> ‘Format Background’ >> ‘Fill’ to ‘Solid fill’ and slide the Transparency slider to 100%.
Then save & right click your shape, and click ‘Save as Picture’, and make sure to save it as a .png file type. This will save the transparency aspect that will be treated as transparent in both psychopy and psycojs.