使用
Surface.get_rect获得
Rect描述你的边界
Surface,然后使用
.collidepoint()来检查,如果鼠标光标这里面
Rect。
例:
if newGameButton.get_rect().collidepoint(pygame.mouse.get_pos()): print "mouse is over 'newGameButton'"

使用
Surface.get_rect获得
Rect描述你的边界
Surface,然后使用
.collidepoint()来检查,如果鼠标光标这里面
Rect。
例:
if newGameButton.get_rect().collidepoint(pygame.mouse.get_pos()): print "mouse is over 'newGameButton'"