Pavlovia won't clear window

URL of experiment: Chromasthesia [PsychoPy]

Description of the problem: This is a bug fixing test run of my experiment. The main issue I experience is that the window won’t be cleared after the routine ends. Basically after “Uebung_Abfrage” the window should be cleared, the new stimulus should be presented and only after it has been presented should “Uebung_Abfrage” present itself with the colour wheel. It doesnt do that, however, it just stays, even after the loop has finished (which is after the 6th repeat). I know I am not supposed to use the win.flip() function as it should be build in, however that seems to be faulty in this case. I would like and appreciate any help.
Regards, Max

Loop:

Edit: Example Screenshots of problem


How are you presenting the colour wheel?

I’ve found that .draw() in Each Frame doesn’t work as well as setAutoDraw(True) and then False for components I want to start/stop in code.

Basically Ive been declaring new functions and then used draw().

function draw_color_wheel() {
    for (let angle = 0; angle < num_colors; angle++) {
        let start_angle = angle * (360 / num_colors);
        let end_angle = (angle + 1) * (360 / num_colors);
        let vertices = create_wedge_vertices(start_angle, end_angle);

        let wedge = new visual.ShapeStim({
            win: psychoJS.window,
            vertices: vertices,
            fillColor: new util.Color(colors[angle]),  // Explicitly use util.Color
            lineColor: new util.Color(colors[angle]),
            closeShape: true,
            autoLog: false
        });
        wedge.draw();
    }
}
draw_color_wheel();

This is the code I used to create the wheel.
would you just swap every .draw() for setAudoDraw(True)?

Create an array of wedges in Begin Experiment.

Cycle through the array to set auto draw true once when you want them to appear and then false when you want them to disappear.

1 Like