How to set the cursor to the text line in PyGame

106 Views Asked by At

I am working on a PyGame Project, and currently working on the inputboxes. Now, if the cursor is hovering over the inputbox, i need it to change to the text cursor. The one you see when editing a .txt file. Right now, i am using pygame.set_cursor, but that doesn't semm to have the option that i want. Does anyone know how to do that? Thanks!

1

There are 1 best solutions below

0
treuss On

The following, which is copied straight from pygame.org docs, works fine for me:

cursor = pygame.cursors.compile(pygame.cursors.textmarker_strings)
pygame.mouse.set_cursor((8, 16), (0, 0), *cursor)