I have a pygame code that rotates the image I need around my axis.
while True: pygame.event.pump() event_handler() if i == 0: prize, needed_angle, angle, deg_count, a = randomize() print(prize) i += 1 if angle >= needed_angle: DSP.fill(backgr) pygame.display.update() i = event_handler() pass elif angle < needed_angle: DSP.fill(backgr) deg_count += a angle += a image_new = pygame.transform.rotozoom(image, angle, 1) image1_new = image_new.get_rect() image1_new.center = (400,400) if (needed_angle - deg_count) <= 495: if (a - 0.0361) > 0: a -= 0.0361 else: pass else: pass DSP.blit(image1, (100,100)) DSP.blit(image_new, image1_new) pygame.display.update() It looks like this: https://www.youtube.com/watch?v=eQxdYb_iKU4
However, if the window loses focus, the code stops working. As I understand it, this is not fixed at all (I need everything to work without focus).
Therefore, I am looking for analogues, but I can not find a suitable one.
Please tell me if there is such a possibility in PyQt or OpenCV, or am I looking at all in the wrong place?
Thank you in advance.

