[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] BUG: Mask.overlap_mask



Hello together,

Mask.overlap_mask does not what it is supposed to do. In the following example, the two counts that are output should be the same. The second one is the one from overlap_mask. I have no clue what goes wrong there, since the results does not make any sense to me.

Please let me know how I can get the correct overlap mask in the case below.

Thanks,
Florian



import pygame

pygame.init()
pygame.display.init()
pygame.display.set_mode((800, 600))
s1 = pygame.Surface((100, 100)).convert_alpha()
s2 = pygame.Surface((200, 200)).convert_alpha()
s1.fill((0,0,0))
s2.fill((0,0,0))

m1 = pygame.mask.from_surface(s1)
m2 = pygame.mask.from_surface(s2)

print m1.overlap_area(m2, (-150, 50))
print m1.overlap_mask(m2, (-150, 50)).count()




--
www.fladd.de - Homepage of Florian Krause