|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
pygame.mouse.get_pos()
I need help! I tryingto write a program that prints the current mouse location to the screen but everytime I try and print it to the screen I get an error saying that I can only print strings or unicode, or that the mouse position is a tuplet and that a tuplet cant be printed/rendered. I tried breaking it apart with [0:1] but that didn't help. Any suggestions?
![]() |
|
#2
|
|||
|
|||
|
That also returns a tuple:
Code:
>>> point = (118,118) >>> point[0:1] (118,) >>> type(_) <type 'tuple'> Try something like: Code:
print str(point) or print "%d, %d" % point or x, y = point print str(x) + ", " + str(y) |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > pygame.mouse.get_pos() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|