Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

canvas copy

edited July 2021 in OpenSesame

Hi all,

I'm working on a script within opensesame for a gaze contingent display. For simplicity, lets just say a small circle that is drawn on the current gaze position. Now the canvas that the subject will be searching doesn't change (other than the circle), but it does consist of many randomly placed elements, so I would prefer not to redraw the canvas from scratch every time I redraw the gaze contingent circle. My first thought was to draw the full set of search elements in the prepare phase, then, in the run phase repeatedly grab a copy of that canvas and draw the circle at gaze position before showing it. Rinse, repeat.

so something like

frontcanvas = canvas()
While....:
        frontcanvas.copy(backpreparedcanvas)
        x,y = sample()
        frontcanvas.circle(x,y)
        frontcanvas.show()

Now this logic seems to work visually, but I get a lot of errors and freezing at the end of experiment. This makes me think that copy() may not be behaving like think it is. My first guess would be that the memory for many frontcanvas objects is not being released, but there doesn't seem to be an explicit way to release it.

Is there a better way that I am missing?

Cheers,

Joe

Comments

Sign In or Register to comment.