| Reference | Downloads | Github

Drawing lines connecting images

Hello. Absolute beginner here, still figuring out psychopy, pavlovia, and coding in python! Just wanted to double check I’m on the right track here.

I created an experiment in builder where I was able to draw lines connecting images in my task fairly easily using something like this:

to get this:

When I tried synching and running the task on pavlovia, all the lines disappeared. I’ve been playing around with it for a while, and all I could figure out is that when I plug in a position that looks like this:
(stim1x , stim1y) , (stim2x , stim2y)

I get this line instead:
(stim1x, stim2x) … assuming I set size to something other than 0,0

I tried feeding the locations in one number at a time via code and with a csv file, but nothing has worked so far. I’m guessing I can get the midpoint between the location of the two images to position the line, and set the orientation by calculating the slope? (edit: wanted to note that the number of images on the bottom changes across trials)

While I try to figure that out, I figured I’d ask on here in case there’s a simpler way to draw lines based on the location of other objects/shapes (and still have the lines show up on pavlovia).