dialogwnd.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:eduActiv8 作者: imiolek-ireneusz 项目源码 文件源码
def handle(self, event):
        if event.type == pygame.MOUSEMOTION or event.type == pygame.MOUSEBUTTONDOWN or event.type == pygame.MOUSEBUTTONUP:
            pos = [event.pos[0] - self.mainloop.game_board.layout.dialogwnd_pos[0],
                   event.pos[1] - self.mainloop.game_board.layout.dialogwnd_pos[1]]
            found = False
            for each in self.elements:
                if each.rect.topleft[0] + each.rect.width >= pos[0] >= each.rect.topleft[0] and each.rect.topleft[
                    1] + each.rect.height >= pos[1] >= each.rect.topleft[1]:
                    each.handle(event)
                    found = True
            if not found:
                for each in self.elements:
                    each.mouse_out()
        else:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号