Calculate portion of ROI looking in each trial

OS (Win):
PsychoPy version (e.g. 2023.1.1):
**Standard Standalone? (y/n)
What are you trying to achieve?:
We connect psychology and GP3. We set an ROI using psychology’s ROI item. Say the position of the ROI is (0.5,0), and the size is (w/h): (0.5,0.05). Then we got GazeSampleEvent output with left_gaze_x, left_gaze_y, etc, most of gaze data are within (-1,1). how do I calculate porpotion of time that participants fixed on the ROI? In other words, how to communicate the coordinates in psychopy layouts with the gaze position output? Assuming the calibration is seccesful, if the gaze data is (0.3,0.3), does it mean the participant looked on a point that is positioned (0.3,0.3) in psychopy? Really appreciate for any help!

What did you try to make it work?:
We tried to use ROI offset time minus ROI onset time then devided by reaction time, but that’s a lot of work and not really ideal. But psychopy data didn’t give other information than the onset ons off set time… and if there’s are multiple looks all the looking time are mixed in the same cell.