How do modify this script to add a striped or dotted pattern to the star shaped stimuli?

44 Views Asked by At

I have this code that creates a star shaped stimuli in psychopy.

from psychopy import visual, event, core

# Set up the window
win = visual.Window(size=(800, 600), fullscr=False, units='pix', color='white')

# Create the star shape
star_vertices = [(0, 0.3), (-0.1, 0.1), (-0.3, 0.1), (-0.15, -0.1),
                 (-0.25, -0.3), (0, -0.2), (0.25, -0.3), (0.15, -0.1),
                 (0.3, 0.1), (0.1, 0.1)]
star = visual.ShapeStim(win, vertices=star_vertices, size=200,
                        lineWidth=1.0, lineColor='black', fillColor='black')

# Draw the star shape
star.draw()

# Update the window
win.flip()

# Wait for the user to close the window
event.waitKeys()

# Close the window
win.close()

How can I change it so that it asks the user to have a striped or dotted pattern and the change the star pattern to the respective one.

I tried looking at the gradient object in psychopy but it doesn't seem to work they way I want it. I want solid stripes that I can change the length of.

0

There are 0 best solutions below