Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Rectangle Penwidth not appearing with PsychoPy backend

Hello all,

I have a sketchpad item which is just a rectangle drawn on a blank background. Here is the code:

set duration 5000
set description "Displays stimuli"
draw rect color=black fill=0 h=960 penwidth=45 show_if=always w=1408 x=-704 y=-480 z_index=0

This is followed by another sketchpad that is the same, except the frame is thicker (larger penwidth):

set duration 5000
set description "Displays stimuli"
draw rect color=black fill=0 h=960 penwidth=90 show_if=always w=1408 x=-704 y=-480 z_index=0

In the preview view of these items, they appear as they should, with the second rectangle much thicker than the first.
However, when I run the program full screen, the 2 rectangles appear to be the exact same, with the exact same thickness. I have tried many different values for the penwidth, all of which appear correctly in the preview view of the sketchpad items, but identical (incorrect) in the full screen run of the program.

Also, this problem only occurs when using the PsychoPy backend for the program. When I run the program using the Epyriment backend, the rectangles appear in different thicknesses in the full screen run. I need to use the PsychoPy backend for this program becuase I need very percise timing for a later phase of this experiment.

I suspect this issue is due to the way the PsychoPy backend is using the penwidth code in the sketchpad item.
If anyone has any idea how to get the thicknesses of the rectangles to change in the program, that would be greatly appreciated!

Thank you,
Harrison

Comments

  • Hi Harrison,

    I vaguely remember there were issues with how Psychopy draws polygons and adjusts the penwidth. One work around would be to draw two rectangles, both filled but the top one slightly smaller and filled with the background color. Do you understand the trick?

    Eduard

  • Eduard,

    That is a great work around, I have the rectangles looking how I want them. Thank you!

Sign In or Register to comment.