Skip to content
Advertisement

Tag: mouseevent

What does ”event.pos[0]” mean in the pygame library? I saw an example using it to get the X axis of the cursor and ignore the Y axis

I don’t understand how it works. I don’t know if I understood the purpose of this function wrong. I tried to search what posx=event.pos[0] means but all I found was that if you want to take x, write the code of posx,posy=pygame.mouse.get_pos() and then take posx. But I still can’t understand the method he followed in the example I saw.

Advertisement