I would like to be able to draw many stimuli of potentially arbitrary shape fast enough that they can be rendered without dropping frames.
I’m aware of ElementArrays and their demo, but it’s not clear to me from that documentation what shapes/objects they work for. My stimuli are arbitrary numpy arrays, which can be added to the screen with visual.ImageStim
. Can these be used with ElementArray?
If not, is there a better way to render these quickly than with something like:
object_list = []
for i in range(n_objects):
object_list.append(visual.ImageStim(...))
for f in range(n_frames):
for i in range(n_objects):
object_list[i].draw()
win.flip()
As the worst case scenario I can pre-render all the frames, save them as images which are loaded into a big array from disk, then just iterate through the big array for each frame. I’m hoping there’s a better way. Thanks!