Pygame - Align screen in center [closed]

0

People are aware of how to align my game screen in the center of the desktop screen?

    
asked by anonymous 06.03.2014 / 18:05

1 answer

3
SDL engine Pygame is based, use the SDL_VIDEO_CENTERED environment variable to indicate that the window should be centered. The variable must be declared before Pygame is started by the init () function.

import pygame
import os 
os.environ['SDL_VIDEO_CENTERED'] = '1'
pygame.init()
    
06.03.2014 / 18:15