コード例 #1
0
ファイル: game.py プロジェクト: Raragyay/Pacman
 def vert_offset_middle(self, surf: pygame.Surface, offset: PVector):
     """
     Get Top Left but with vertical offset option
     :param surf:
     :param offset:
     :return:
     """
     return PVector.to_tuple(
         PVector.from_tuple(self.get_top_left(surf)) + offset)
コード例 #2
0
ファイル: game.py プロジェクト: Raragyay/Pacman
 def get_top_left(self, surf: pygame.Surface):
     """
     Utility
     :param surf:
     :return:
     """
     surf_half_size = PVector.from_tuple(surf.get_size()) / 2  # Center
     screen_center = PVector.from_tuple(
         self.screen.get_size()) / 2  # Center
     return PVector.to_tuple(screen_center - surf_half_size)  # Offset