Reputation: 27
I would greatly appreciate it if anyone could tell me how to show the rectangle of an image after calling get_rect()
on that image
I have done this:
self.sword_rect = sword_swing.get_rect()
self.sword_rect.center = (self.player_x, self.player_y)
and want to see where it is on the screen
Is this possible? If so, how?
Thanks in advance
Upvotes: 1
Views: 55
Reputation: 210878
I recommend to use pygame.draw.rect()
. For instance:
color = (255, 0, 0)
pygame.draw.rect(screen, color, self.sword_rect, 1)
(screen
is the surface which is associated to the display)
Upvotes: 1