pygame   documentation
||  Home  ||  Help Contents  ||
 
|| pygame || cdrom || constants || cursor || display || draw ||
|| event || font || image || joystick || key || mixer ||
|| mixer_music || mouse || movie || sndarray || surfarray || time ||
|| transform ||
 
|| CD || Channel || Clock || Font || Joystick || Movie ||
|| Overlay || Rect || Sound || Surface ||
 
|| color || cursors || sprite ||

pygame.display

Contains routines to work with the display. Mainly used for setting the display mode and updating the display surface.
 
Pygame offers a fairly simple interface to the display buffer. The buffer is represented as an offscreen surface to which you can write directly. If you want the screen to show what you have written, the pygame.display.update() function will guarantee the the desired portion of the screen is updated. You can call pygame.display.flip() to update the entire screen, and also flip a hardware surface created with DOUBLEBUF.
 
There are a number of ways to start the video display. The easiest way is to pick a common screen resolution and depth and just initialize the video, checking for exceptions. You will probably get what you want, but pygame may be emulating your requested mode and converting the display on update (this is not the fastest method). When calling pygame.display.set_mode() with the bit depth omitted or set to zero, pygame will determine the best video mode available and set to that. You can also query for more information on video modes with pygame.display.mode_ok(), pygame.display.list_modes(), and pygame.display.Info().
 
When using a display depth other than what you graphic resources may be saved at, it is best to call the Surface.convert() routine to convert them to the same format as the display, this will result in the fastest blitting.
 
Pygame currently supports any but depth >= 8 bits per pixl. 8bpp formats are considered to be 8-bit palettized modes, while 12, 15, 16, 24, and 32 bits per pixel are considered 'packed pixel' modes, meaning each pixel contains the RGB color componsents packed into the bits of the pixel.
 
After you have initialized your video mode, you can take the surface that was returned and write to it like any other Surface object. Be sure to call update() or flip() to keep what is on the screen synchronized with what is on the surface. Be sure not to call display routines that modify the display surface while it is locked.
Info - get display capabilities and settings
flip - update the display
get_active - get state of display mode
get_caption - get the current title of the window
get_driver - get the current sdl video driver
get_init - get status of display module initialization
get_surface - get current display surface
get_wm_info - get settings from the system window manager
gl_get_attribute - get special OPENGL attributes
gl_set_attribute - set special OPENGL attributes
iconify - minimize the display window
init - initialize the display module
list_modes - query all resolutions for requested mode
mode_ok - query a specific display mode
quit - uninitialize the display module
set_caption - changes the title of the window
set_gamma - change the brightness of the display
set_gamma_ramp - advanced control over the display gamma ramps
set_icon - changes the window manager icon for the window
set_mode - set the display mode
set_palette - set the palette
toggle_fullscreen - switch the display fullscreen mode
update - update an area of the display

Info
pygame.display.Info() -> VidInfo
 
flip
pygame.display.flip() -> None
 
get_active
pygame.display.get_active() -> bool

 
get_caption
pygame.display.get_caption() -> title, icontitle
 
get_driver
pygame.display.get_driver() -> name
 
get_init
pygame.display.get_init() -> bool
 
get_surface
pygame.display.get_surface() -> Surface
 
get_wm_info
pygame.display.get_wm_info() -> dictionary
 
gl_get_attribute
pygame.display.gl_get_attribute(flag) -> value

 
gl_set_attribute
pygame.display.gl_set_attribute(flag, value) -> None

 
iconify
pygame.display.iconify() -> bool
 
init
pygame.display.init() -> None
 
list_modes
pygame.display.list_modes([depth, [flags]]) -> [[x,y],...] | -1
 
mode_ok
pygame.display.mode_ok(size, [flags, [depth]]) -> int

 
quit
pygame.display.quit() -> None
 
set_caption
pygame.display.set_caption(title, [icontitle]) -> None
 
set_gamma
pygame.display.set_gamma(r, [g, b]) -> bool
 
set_gamma_ramp
pygame.display.set_gamma_ramp(r, g, b) -> bool
 
set_icon
pygame.display.set_icon(Surface) -> None
 
set_mode
pygame.display.set_mode(size, [flags, [depth]]) -> Surface

 
set_palette
pygame.display.set_palette([[r, g, b], ...]) -> None
 
toggle_fullscreen
pygame.display.toggle_fullscreen() -> bool
 
update
pygame.display.update([rectstyle]) -> None