def scalePercentage(self, surface, perc): screenRect = self.screen.get_rect() surface = pygame.transform.scale(surface, (int(perc*screenRect.width), int(perc*screenRect.height))) return surface