저는 파이 게임에서 rect 내에서 클릭했는지 여부를 감지하는 방법을 찾을 수 없습니다. 나중에Python에서 rect를 클릭하기위한 테스트
if self.click: #(this is true if mouse button is down)
if self.mouserect.colliderect(self.a_thing_to_click_on.rect):
do_stuff
다음
self.mouserect=(pygame.mouse.get_pos(), 8,8)
및 시도하지만 나에게 AttributeError을 제공합니다 : '튜플'개체가 어떤 속성 'colliderect를'이 없습니다. 내가 도대체 뭘 잘못하고있는 겁니까?
저에게 제공합니다. TypeError : 인수는 rect 스타일 객체 여야합니다 ... – Alex
정확히 어떤 줄에 있습니까? – Ikke