Designing responsive visual stimuli based on gaze (in/out roi)

OS (e.g. Win10): Win11
PsychoPy version (e.g. 1.84.x): Latest
Standard Standalone? (y/n) y
What are you trying to achieve?:

Dear Psychopy community, I am trying to design a gaze-contingent crowding experiment mixed with a spatial attention bias task. My design is to set up a roi in the centre of the screen (around a fixation cross), and the bilateral presented stimuli would change responsively to the participant’s gaze location (e.g. show image 1 when the gaze stayed in the roi, and show image 2 when gazing outside the roi). I have looked into the aperture function, but it’s not what I aim for.

To my imagination, I could use the roi module to determine the on/offset time for image 2 (as a mask to image 1), but I am not sure how to achieve that within the builder code component (or any component). I wonder if anyone has tried creating gaze-contingent crowding or similar paradigms with Psychopy and could share some insights with me. Cheers!