Skorpio
2014-05-22 10:47:19 UTC
Hi everybody,
How can you scale the hitbox of a sprite? I tried self.rect =
self.rect.inflate(-85, -20) and that scaled the rect correctly (to the
center of the rect), but the game still takes the upper left corner of the
rect as the blit position for the image/surface. That means the rect covers
only the upper left part of the sprite, so that the left half of the sprite
image can be hit and the right half can't be hit.
Regards,
Skorpio
--
View this message in context: http://pygame-users.25799.x6.nabble.com/pygame-Scaling-the-hitbox-rect-of-a-sprite-tp1227.html
Sent from the pygame-users mailing list archive at Nabble.com.
How can you scale the hitbox of a sprite? I tried self.rect =
self.rect.inflate(-85, -20) and that scaled the rect correctly (to the
center of the rect), but the game still takes the upper left corner of the
rect as the blit position for the image/surface. That means the rect covers
only the upper left part of the sprite, so that the left half of the sprite
image can be hit and the right half can't be hit.
Regards,
Skorpio
--
View this message in context: http://pygame-users.25799.x6.nabble.com/pygame-Scaling-the-hitbox-rect-of-a-sprite-tp1227.html
Sent from the pygame-users mailing list archive at Nabble.com.