Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pygame get mouse position

x,y = pygame.mouse.get_pos()
#get the mouse cursor position
#get_pos() -> (x, y)
#Returns the X and Y position of the mouse cursor.
#The position is relative to the top-left corner of the display.
#The cursor position can be located outside of the display window,
#but is always constrained to the screen.
Comment

pygame mouse pos

 pygame.mouse.get_pos()
    get the mouse cursor position
    get_pos() -> (x, y)

    Returns the x and y position of the mouse cursor. 
    The position is relative to the top-left corner of the display. 
    The cursor position can be located outside of the display window,
    but is always constrained to the screen.
Comment

pygame mouse pos

x, y = pygame.mouse.get_pos()
print(x, y)
Comment

PREVIOUS NEXT
Code Example
Python :: tkinter listbox delete all items 
Python :: how to install numpy 
Python :: numpy install wtih conda 
Python :: python all possible combinations of multiple lists 
Python :: how to check datatype of column in dataframe python 
Python :: how clear everything on canvas in tkinter 
Python :: python install pandas for linux 
Python :: random date python 
Python :: flask get ip address of request 
Python :: pd read csv unname 
Python :: import xgboost 
Python :: python shebang line 
Python :: popups in tkinter 
Python :: image in cv2 
Python :: save dictionary python 
Python :: python code region 
Python :: create an array from 1 to n python 
Python :: pytest --clrear cache 
Python :: flask run app reset on change 
Python :: save machine learning model python 
Python :: datetime not defined python 
Python :: python iterate dictionary in reverse order 
Python :: python alphabet 
Python :: save model pickle 
Python :: opencv get area of contour 
Python :: f string round 
Python :: python gui capture user input 
Python :: time it in jupyter notebook 
Python :: py sleep function 
Python :: python beautifulsoup write to file 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =