I need advice about one stimuli

Hello all,

I am currently working on an experiment. In short, I need the arrow stimulus. I don’t want to use pictures. What suggestions do you have about it?

I read that someone did the arrow stimulus as in the link below, but since I’m a beginner in python coding, could you please tell me how I can do this in a more simplified way?

Thank you in advance,

They might not be the prettiest you could do this “<-- / -->”

Go to the demos menu, and from the “Coder” demos, select shapes.py and run it. It is a demo of creating arbitrary polygons. This is code from it that creates an arrow-shaped stimulus:

arrowVert = [(-0.4,0.05),(-0.4,-0.05),(-.2,-0.05),(-.2,-0.1),(0,0),(-.2,0.1),(-.2,0.05)]
arrow = ShapeStim(win, vertices=arrowVert, fillColor='darkred', size=.5, lineColor='red')

If you’re not up for coding this yourself, you could probably just use the Polygon component in Builder. On its “basic” tab, select “Custom polygon” for the shape, and paste in the list of vertices given above, i.e:

[(-0.4, 0.05), (-0.4, -0.05), (-.2, -0.05), (-.2, -0.1), (0, 0), (-.2, 0.1), (-.2, 0.05)]
1 Like

We need more detail to suggest how to help – “it doesn’t work” doesn’t tell us anything useful.

I also think image or polygon components are best for maximizing your control over how the arrow stimulus appears, so if images are not an option, I would opt for the polygon component.

However, if you wanted to use text components you could try the unicode character arrows:
U+2190 = ←
U+2191 = ↑
U+2192 = →
U+2193 = ↓

The text box of your text component will contain: ← or whichever arrow you want to display.

If you are setting the arrow in a different direction every repeat, the text component would be:
$VAR
and column VAR in your trial spreadsheet would contain the unicode symbol: ←

I tested this in PsychoPy 2022.1.1 Builder and it seemed to work in both PsychoPy and PsychoJS.

3 Likes