Pages

vineri, 9 august 2013

PyGame : First interface - part 3.

Today I will show you just a few tips about pygame window.
If we want to put the window in the center of the screen we can use this:
import os
os.environ['SDL_VIDEO_CENTERED'] = '1'
Most of the pygame windows are made by :
def main():
  background_colour = (25,25,255)
  screen = pygame.display.set_mode((320,240))
  screen.fill(background_colour)
This will create this window:

Now if you don't need a title window, like the next image...

... then you need to use this source code :
  screen = pygame.display.set_mode((320,240),NOFRAME)