Hi there,
I’m programming an experiment in psychopy/python and would like to use a custom defined object (rectangle) as the marker for my rating scale.
As the documentation for visual.ratingscale says ‘Can also be set to a custom marker stimulus: any object with a .draw() method’, I was hoping to be able to set up a rectangle using visual.Rect and then draw this as the marker for the rating scale. However this does not work and I don’t know what to make of the rather unspecific error messages.
When I use text (using visual.TextStim) as a marker, as given in the documentation’s example, this works without problems.
Here is my code:
- this does’t work:
rect_rate = visual.Rect(win, size=[0.5,1.5], units='cm', lineColor=[3, 157, 252], fillColor=[3, 157, 252])
rating_scale = visual.RatingScale(win=win, name='rating_scale',
marker=rect_rate, size=1.5, stretch=1.2, pos=[0.0, 0.0], low=0, high=1,
precision=100, showValue=False, scale=None, showAccept = False, labels=['100% angry',
'100% sad'])
- this does work:
text = visual.TextStim(win, text='blablabla', units='norm')
rating_scale = visual.RatingScale(win=win, name='rating_scale',
marker=text, size=1.5, stretch=1.2, pos=[0.0, 0.0], low=0, high=1,
precision=100, showValue=False, scale=None, showAccept = False, labels=['100% angry',
'100% sad'])
I’m new to python/psychopy so would be very happy about any ideas about what is amiss here. Thanks!