Learn Before
  • Using the Display Module in Pygame

Create a Display Surface in Pygame

You can create a display surface by using the set_mode method on pygame.display. It will take in five parameters: size, flags, depth, and vsync. The size is the width and height of the desired display. The flags param controls which type of dipslay you want. Depth dictates the number of bits to use for color, which should be left empty since pygame will automatically find the appropriate color depth to display. The display param Vsync allows you to enable vysnc on the game, but requires certain flags to be set and may not work depending on hardware specs of your machine. The set_mode command is shown below.

pygame.display.set_mode(size=(0, 0), flags=0, depth=0, vsync=0)

0

1

4 years ago

Tags

Python Programming Language

Data Science

Related
  • Initialize/uninitialize a display in Pygame

  • Create a Display Surface in Pygame

  • Updating the Display in Pygame

Learn After
  • Flags For Initializing a Display in Pygame