pygame / docs / ref / display.html

<html>
<title>display - Pygame Documentation</title>
<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>


<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
<tr>
<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
	||&nbsp;
	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
	<a href=../index.html>Help Contents</a> &nbsp;||
	<a href=index.html>Reference Index</a> &nbsp;||
	<br>&nbsp;<br>
	
<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
<a href="display.html">Display</a>&nbsp;||&nbsp;
<a href="draw.html">Draw</a>&nbsp;||&nbsp;
<a href="event.html">Event</a>&nbsp;||&nbsp;
<a href="font.html">Font</a>&nbsp;||&nbsp;
<a href="image.html">Image</a>&nbsp;||&nbsp;
<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
<a href="key.html">Key</a>&nbsp;||&nbsp;
<a href="mask.html">Mask</a>&nbsp;||&nbsp;
<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
<a href="movie.html">Movie</a>&nbsp;||&nbsp;
<a href="music.html">Music</a>&nbsp;||&nbsp;
<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
<a href="rect.html">Rect</a>&nbsp;||&nbsp;
<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
<a href="surface.html">Surface</a>&nbsp;||&nbsp;
<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
<a href="time.html">Time</a>&nbsp;||&nbsp;
<a href="transform.html">Transform</a>
</td></tr></table>
<br>


<a name="pygame.display">
<big><b>pygame.display</big></b><br><ul>
  <i>pygame module to control the display window and screen</i><br>
<ul><small><table>
  <tr><td><a href="display.html#pygame.display.init">pygame.display.init</a> - <font size=-1>initialize the display module</font></td><td>initialize the display module</td></tr>
  <tr><td><a href="display.html#pygame.display.quit">pygame.display.quit</a> - <font size=-1>uninitialize the display module</font></td><td>uninitialize the display module</td></tr>
  <tr><td><a href="display.html#pygame.display.get_init">pygame.display.get_init</a> - <font size=-1>true if the display module is initialized</font></td><td>true if the display module is initialized</td></tr>
  <tr><td><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></td><td>initialize a window or screen for display</td></tr>
  <tr><td><a href="display.html#pygame.display.get_surface">pygame.display.get_surface</a> - <font size=-1>get a reference to the currently set display surface</font></td><td>get a reference to the currently set display surface</td></tr>
  <tr><td><a href="display.html#pygame.display.flip">pygame.display.flip</a> - <font size=-1>update the full display Surface to the screen</font></td><td>update the full display Surface to the screen</td></tr>
  <tr><td><a href="display.html#pygame.display.update">pygame.display.update</a> - <font size=-1>update portions of the screen for software displays</font></td><td>update portions of the screen for software displays</td></tr>
  <tr><td><a href="display.html#pygame.display.get_driver">pygame.display.get_driver</a> - <font size=-1>get the name of the pygame display backend</font></td><td>get the name of the pygame display backend</td></tr>
  <tr><td><a href="display.html#pygame.display.Info">pygame.display.Info</a> - <font size=-1>Create a video display information object</font></td><td>Create a video display information object</td></tr>
  <tr><td><a href="display.html#pygame.display.get_wm_info">pygame.display.get_wm_info</a> - <font size=-1>Get information about the current windowing system</font></td><td>Get information about the current windowing system</td></tr>
  <tr><td><a href="display.html#pygame.display.list_modes">pygame.display.list_modes</a> - <font size=-1>get list of available fullscreen modes</font></td><td>get list of available fullscreen modes</td></tr>
  <tr><td><a href="display.html#pygame.display.mode_ok">pygame.display.mode_ok</a> - <font size=-1>pick the best color depth for a display mode</font></td><td>pick the best color depth for a display mode</td></tr>
  <tr><td><a href="display.html#pygame.display.gl_get_attribute">pygame.display.gl_get_attribute</a> - <font size=-1>get the value for an opengl flag for the current display</font></td><td>get the value for an opengl flag for the current display</td></tr>
  <tr><td><a href="display.html#pygame.display.gl_set_attribute">pygame.display.gl_set_attribute</a> - <font size=-1>request an opengl display attribute for the display mode</font></td><td>request an opengl display attribute for the display mode</td></tr>
  <tr><td><a href="display.html#pygame.display.get_active">pygame.display.get_active</a> - <font size=-1>true when the display is active on the display</font></td><td>true when the display is active on the display</td></tr>
  <tr><td><a href="display.html#pygame.display.iconify">pygame.display.iconify</a> - <font size=-1>iconify the display surface</font></td><td>iconify the display surface</td></tr>
  <tr><td><a href="display.html#pygame.display.toggle_fullscreen">pygame.display.toggle_fullscreen</a> - <font size=-1>switch between fullscreen and windowed displays</font></td><td>switch between fullscreen and windowed displays</td></tr>
  <tr><td><a href="display.html#pygame.display.set_gamma">pygame.display.set_gamma</a> - <font size=-1>change the hardware gamma ramps</font></td><td>change the hardware gamma ramps</td></tr>
  <tr><td><a href="display.html#pygame.display.set_gamma_ramp">pygame.display.set_gamma_ramp</a> - <font size=-1>set_gamma_ramp(red, green, blue): return bool</font></td><td>set_gamma_ramp(red, green, blue): return bool</td></tr>
  <tr><td><a href="display.html#pygame.display.set_icon">pygame.display.set_icon</a> - <font size=-1>change the system image for the display window</font></td><td>change the system image for the display window</td></tr>
  <tr><td><a href="display.html#pygame.display.set_caption">pygame.display.set_caption</a> - <font size=-1>set the current window caption</font></td><td>set the current window caption</td></tr>
  <tr><td><a href="display.html#pygame.display.get_caption">pygame.display.get_caption</a> - <font size=-1>get the current window caption</font></td><td>get the current window caption</td></tr>
  <tr><td><a href="display.html#pygame.display.set_palette">pygame.display.set_palette</a> - <font size=-1>set the display color palette for indexed displays</font></td><td>set the display color palette for indexed displays</td></tr>
</table></small></ul>
<p>This module offers control over the pygame display. Pygame has a single display Surface that is either contained in a window or runs full screen. Once you create the display you treat it as a regular Surface. Changes are not immediately visible onscreen, you must choose one of the two flipping functions to update the actual display. </p>
<p>The origin of the display, where x = 0, and y = 0 is the top left of the screen. Both axis increase positively towards the botom right of the screen. </p>
<p>The pygame display can actually be initialized in one of several modes. By default the display is a basic software driven framebuffer. You can request special modules like hardware acceleration and OpenGL support. These are controlled by flags passed to <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt>. </p>
<p>Pygame can only have a single display active at any time. Creating a new one with <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> will close the previous display. If precise control is needed over the pixel format or display resolutions, use the functions <tt><a href="display.html#pygame.display.mode_ok">pygame.display.mode_ok</a> - <font size=-1>pick the best color depth for a display mode</font></tt>, <tt><a href="display.html#pygame.display.list_modes">pygame.display.list_modes</a> - <font size=-1>get list of available fullscreen modes</font></tt>, and <tt><a href="display.html#pygame.display.Info">pygame.display.Info</a> - <font size=-1>Create a video display information object</font></tt> to query information about the display. </p>
<p>Once the display Surface is created, the functions from this module effect the single existing display. The Surface becomes invalid if the module is uninitialized. If a new display mode is set, the existing Surface will automatically switch to operate on the new display. </p>
<p>Then the display mode is set, several events are placed on the pygame event queue. <tt>pygame.QUIT</tt> is sent when the user has requested the program to shutdown. The window will receive <tt>pygame.ACTIVEEVENT</tt> events as the display gains and loses input focus. If the display is set with the <tt>pygame.RESIZABLE</tt> flag, <tt>pygame.VIDEORESIZE</tt> events will be sent when the user adjusts the window dimensions. Hardware displays that draw direct to the screen will get <tt>pygame.VIDEOEXPOSE</tt> events when portions of the window must be redrawn. </p>
<!--COMMENTS:pygame.display--> &nbsp;<br> 


<a name="pygame.display.init">
<big><b>pygame.display.init</big></b><br><ul>
  <i>initialize the display module</i><br>
  <tt>pygame.display.init(): return None</tt><br>
<p>Initializes the pygame display module. The display module cannot do anything until it is initialized. This is usually handled for you automatically when you call the higher level <tt><a href="pygame.html#pygame.init">pygame.init</a> - <font size=-1>initialize all imported pygame modules</font></tt>. </p>
<p>Pygame will select from one of several internal display backends when it is initialized. The display mode will be chosen depending on the platform and permissions of current user. Before the display module is initialized the environment variable <tt>SDL_VIDEODRIVER</tt> can be set to control which backend is used. The systems with multiple choices are listed here. </p>
<pre>   Windows : windib, directx
   Unix    : x11, dga, fbcon, directfb, ggi, vgl, svgalib, aalib
</pre><p>On some platforms it is possible to embed the pygame display into an already existing window. To do this, the environment variable <tt>SDL_WINDOWID</tt> must be set to a string containing the window id or handle. The environment variable is checked when the pygame display is initialized. Be aware that there can be many strange side effects when running in an embedded display. </p>
<p>It is harmless to call this more than once, repeated calls have no effect. </p>
<!--COMMENTS:pygame.display.init--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.quit">
<big><b>pygame.display.quit</big></b><br><ul>
  <i>uninitialize the display module</i><br>
  <tt>pygame.display.quit(): return None</tt><br>
<p>This will shut down the entire display module. This means any active displays will be closed. This will also be handled automatically when the program exits. </p>
<p>It is harmless to call this more than once, repeated calls have no effect. </p>
<!--COMMENTS:pygame.display.quit--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.get_init">
<big><b>pygame.display.get_init</big></b><br><ul>
  <i>true if the display module is initialized</i><br>
  <tt>pygame.display.get_init(): return bool</tt><br>
<p>Returns True if the <tt>pygame.display</tt> module is currently initialized. </p>
<!--COMMENTS:pygame.display.get_init--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.set_mode">
<big><b>pygame.display.set_mode</big></b><br><ul>
  <i>initialize a window or screen for display</i><br>
  <tt>pygame.display.set_mode(resolution=(0,0), flags=0, depth=0): return Surface</tt><br>
<p>This function will create a display Surface. The arguments passed in are requests for a display type. The actual created display will be the best possible match supported by the system. </p>
<p>The resolution argument is a pair of numbers representing the width and height. The flags argument is a collection of additional options. The depth argument represents the number of bits to use for color. </p>
<p>The Surface that gets returned can be drawn to like a regular Surface but changes will eventually be seen on the monitor. </p>
<p>If no resolution is passed or is set to (0, 0) and pygame uses <tt>SDL</tt> version <tt>1.2.10</tt> or above, the created Surface will have the same size as the current screen resolution. If only the width or height are set to 0, the Surface will have the same width or height as the screen resolution. Using a <tt>SDL</tt> version prior to <tt>1.2.10</tt> will raise an exception. </p>
<p>It is usually best to not pass the depth argument. It will default to the best and fastest color depth for the system. If your game requires a specific color format you can control the depth with this argument. Pygame will emulate an unavailable color depth which can be slow. </p>
<p>When requesting fullscreen display modes, sometimes an exact match for the requested resolution cannot be made. In these situations pygame will select the closest compatable match. The returned surface will still always match the requested resolution. </p>
<p>The flags argument controls which type of display you want. There are several to choose from, and you can even combine multiple types using the bitwise or operator, (the pipe "|" character). If you pass 0 or no flags argument it will default to a software driven window. Here are the display flags you will want to choose from: </p>
<pre>   pygame.FULLSCREEN    create a fullscreen display
   pygame.DOUBLEBUF     recommended for HWSURFACE or OPENGL
   pygame.HWSURFACE     hardware accelereated, only in FULLSCREEN
   pygame.OPENGL        create an opengl renderable display
   pygame.RESIZABLE     display window should be sizeable
   pygame.NOFRAME       display window will have no border or controls
</pre>
<!--COMMENTS:pygame.display.set_mode--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.get_surface">
<big><b>pygame.display.get_surface</big></b><br><ul>
  <i>get a reference to the currently set display surface</i><br>
  <tt>pygame.display.get_surface(): return Surface</tt><br>
<p>Return a reference to the currently set display Surface. If no display mode has been set this will return None. </p>
<!--COMMENTS:pygame.display.get_surface--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.flip">
<big><b>pygame.display.flip</big></b><br><ul>
  <i>update the full display Surface to the screen</i><br>
  <tt>pygame.display.flip(): return None</tt><br>
<p>This will update the contents of the entire display. If your display mode is using the flags <tt>pygame.HWSURFACE</tt> and <tt>pygame.DOUBLEBUF</tt>, this will wait for a vertical retrace and swap the surfaces. If you are using a different type of display mode, it will simply update the entire contents of the surface. </p>
<p>When using an <tt>pygame.OPENGL</tt> display mode this will perform a gl buffer swap. </p>
<!--COMMENTS:pygame.display.flip--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.update">
<big><b>pygame.display.update</big></b><br><ul>
  <i>update portions of the screen for software displays</i><br>
  <tt>pygame.display.update(rectangle=None): return None</tt><br>
  <tt>pygame.display.update(rectangle_list): return None</tt><br>
<p>This function is like an optimized version of <tt><a href="display.html#pygame.display.flip">pygame.display.flip</a> - <font size=-1>update the full display Surface to the screen</font></tt> for software displays. It allows only a portion of the screen to updated, instead of the entire area. If no argument is passed it updates the entire Surface area like <tt><a href="display.html#pygame.display.flip">pygame.display.flip</a> - <font size=-1>update the full display Surface to the screen</font></tt>. </p>
<p>You can pass the function a single rectangle, or a sequence of rectangles. It is more efficient to pass many rectangles at once than to call update multiple times with single or a partial list of rectangles. If passing a sequence of rectangles it is safe to include None values in the list, which will be skipped. </p>
<p>This call cannot be used on <tt>pygame.OPENGL</tt> displays and will generate an exception. </p>
<!--COMMENTS:pygame.display.update--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.get_driver">
<big><b>pygame.display.get_driver</big></b><br><ul>
  <i>get the name of the pygame display backend</i><br>
  <tt>pygame.display.get_driver(): return name</tt><br>
<p>Pygame chooses one of many available display backends when it is initialized. This returns the internal name used for the display backend. This can be used to provide limited information about what display capabilities might be accelerated. See the <tt>SDL_VIDEODRIVER</tt> flags in <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> to see some of the common options. </p>
<!--COMMENTS:pygame.display.get_driver--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.Info">
<big><b>pygame.display.Info</big></b><br><ul>
  <i>Create a video display information object</i><br>
  <tt>pygame.display.Info(): return VideoInfo</tt><br>
<p>Creates a simple object containing several attributes to describe the current graphics environment. If this is called before <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> some platforms can provide information about the default display mode. This can also be called after setting the display mode to verify specific display options were satisfied. The VidInfo object has several attributes: </p>
<pre>  hw:         True if the display is hardware accelerated
  wm:         True if windowed display modes can be used
  video_mem:  The megabytes of video memory on the display. This is 0 if unknown
  bitsize:    Number of bits used to store each pixel
  bytesize:   Number of bytes used to store each pixel
  masks:      Four values used to pack RGBA values into pixels
  shifts:     Four values used to pack RGBA values into pixels
  losses:     Four values used to pack RGBA values into pixels
  blit_hw:    True if hardware Surface blitting is accelerated
  blit_hw_CC: True if hardware Surface colorkey blitting is accelerated
  blit_hw_A:  True if hardware Surface pixel alpha blitting is accelerated
  blit_sw:    True if software Surface blitting is accelerated
  blit_sw_CC: True if software Surface colorkey blitting is accelerated
  blit_sw_A:  True if software Surface pixel alpha blitting is acclerated
  current_h, current_h:  Width and height of the current video mode, or of the
    desktop mode if called before the display.set_mode is called.
    (current_h, current_w are available since SDL 1.2.10, and pygame 1.8.0)
    They are -1 on error, or if an old SDL is being used.
</pre>
<!--COMMENTS:pygame.display.Info--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.get_wm_info">
<big><b>pygame.display.get_wm_info</big></b><br><ul>
  <i>Get information about the current windowing system</i><br>
  <tt>pygame.display.get_wm_info(): return dict</tt><br>
<p>Creates a dictionary filled with string keys. The strings and values are arbitrarily created by the system. Some systems may have no information and an empty dictionary will be returned. Most platforms will return a "window" key with the value set to the system id for the current display. </p>
<p>New with pygame <tt>1.7.1</tt> </p>
<!--COMMENTS:pygame.display.get_wm_info--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.list_modes">
<big><b>pygame.display.list_modes</big></b><br><ul>
  <i>get list of available fullscreen modes</i><br>
  <tt>pygame.display.list_modes(depth=0, flags=pygame.FULLSCREEN): return list</tt><br>
<p>This function returns a list of possible dimensions for a specified color depth. The return value will be an empty list if no display modes are available with the given arguments. <tt>A</tt> return value of -1 means that any requested resolution should work (this is likely the case for windowed modes). Mode sizes are sorted from biggest to smallest. </p>
<p>If depth is 0, <tt>SDL</tt> will choose the current/best color depth for the display. The flags defaults to <tt>pygame.FULLSCREEN</tt>, but you may need to add additional flags for specific fullscreen modes. </p>
<!--COMMENTS:pygame.display.list_modes--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.mode_ok">
<big><b>pygame.display.mode_ok</big></b><br><ul>
  <i>pick the best color depth for a display mode</i><br>
  <tt>pygame.display.mode_ok(size, flags=0, depth=0): return depth</tt><br>
<p>This function uses the same arguments as <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt>. It is used to depermine if a requested display mode is available. It will return 0 if the display mode cannot be set. Otherwise it will return a pixel depth that best matches the display asked for. </p>
<p>Usually the depth argument is not passed, but some platforms can support multiple display depths. If passed it will hint to which depth is a better match. </p>
<p>The most useful flags to pass will be <tt>pygame.HWSURFACE</tt>, <tt>pygame.DOUBLEBUF</tt>, and maybe <tt>pygame.FULLSCREEN</tt>. The function will return 0 if these display flags cannot be set. </p>
<!--COMMENTS:pygame.display.mode_ok--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.gl_get_attribute">
<big><b>pygame.display.gl_get_attribute</big></b><br><ul>
  <i>get the value for an opengl flag for the current display</i><br>
  <tt>pygame.display.gl_get_attribute(flag): return value</tt><br>
<p>After calling <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> with the <tt>pygame.OPENGL</tt> flag, it is a good idea to check the value of any requested OpenGL attributes. See <tt>pygame.display.get_set_attribute()</tt> for a list of valid flags. </p>
<!--COMMENTS:pygame.display.gl_get_attribute--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.gl_set_attribute">
<big><b>pygame.display.gl_set_attribute</big></b><br><ul>
  <i>request an opengl display attribute for the display mode</i><br>
  <tt>pygame.display.gl_set_attribute(flag, value): return None</tt><br>
<p>When calling <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> with the <tt>pygame.OPENGL</tt> flag, Pygame automatically handles setting the OpenGL attributes like color and doublebuffering. OpenGL offers several other attributes you may want control over. Pass one of these attributes as the flag, and its appropriate value. This must be called before <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> </p>
<p>The <tt>OPENGL</tt> flags are; </p>
<pre>  GL_ALPHA_SIZE, GL_DEPTH_SIZE, GL_STENCIL_SIZE, GL_ACCUM_RED_SIZE,
  GL_ACCUM_GREEN_SIZE,  GL_ACCUM_BLUE_SIZE, GL_ACCUM_ALPHA_SIZE,
  GL_MULTISAMPLEBUFFERS, GL_MULTISAMPLESAMPLES, GL_STEREO
</pre>
<!--COMMENTS:pygame.display.gl_set_attribute--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.get_active">
<big><b>pygame.display.get_active</big></b><br><ul>
  <i>true when the display is active on the display</i><br>
  <tt>pygame.display.get_active(): return bool</tt><br>
<p>After <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> is called the display Surface will be visible on the screen. Most windowed displays can be hidden by the user. If the display Surface is hidden or iconified this will return False. </p>
<!--COMMENTS:pygame.display.get_active--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.iconify">
<big><b>pygame.display.iconify</big></b><br><ul>
  <i>iconify the display surface</i><br>
  <tt>pygame.display.iconify(): return bool</tt><br>
<p>Request the window for the display surface be iconified or hidden. Not all systems and displays support an iconified display. The function will return True if successfull. </p>
<p>When the display is iconified <tt><a href="display.html#pygame.display.get_active">pygame.display.get_active</a> - <font size=-1>true when the display is active on the display</font></tt> will return False. The event queue should receive a <tt>ACTIVEEVENT</tt> event when the window has been iconified. </p>
<!--COMMENTS:pygame.display.iconify--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.toggle_fullscreen">
<big><b>pygame.display.toggle_fullscreen</big></b><br><ul>
  <i>switch between fullscreen and windowed displays</i><br>
  <tt>pygame.display.toggle_fullscreen(): return bool</tt><br>
<p>Switches the display window between windowed and fullscreen modes. This function only works under the unix x11 video driver. For most situations it is better to call <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> with new display flags. </p>
<!--COMMENTS:pygame.display.toggle_fullscreen--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.set_gamma">
<big><b>pygame.display.set_gamma</big></b><br><ul>
  <i>change the hardware gamma ramps</i><br>
  <tt>pygame.display.set_gamma(red, green=None, blue=None): return bool</tt><br>
<p>Set the red, green, and blue gamma values on the display hardware. If the green and blue arguments are not passed, they will both be the same as red. Not all systems and hardware support gamma ramps, if the function succeeds it will return True. </p>
<p><tt>A</tt> gamma value of <tt>1.0</tt> creates a linear color table. Lower values will darken the display and higher values will brighten. </p>
<!--COMMENTS:pygame.display.set_gamma--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.set_gamma_ramp">
<big><b>pygame.display.set_gamma_ramp</big></b><br><ul>
  <i>set_gamma_ramp(red, green, blue): return bool</i><br>
  <tt>change the hardware gamma ramps with a custom lookup</tt><br>
  <tt>pygame.display.set_gamma_ramp(red, green, blue): return bool</tt><br>
<p>Set the red, green, and blue gamma ramps with an explicit lookup table. Each argument should be sequence of 256 integers. The integers should range between 0 and 0xffff. Not all systems and hardware support gamma ramps, if the function succeeds it will return True. </p>
<!--COMMENTS:pygame.display.set_gamma_ramp--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.set_icon">
<big><b>pygame.display.set_icon</big></b><br><ul>
  <i>change the system image for the display window</i><br>
  <tt>pygame.display.set_icon(Surface): return None</tt><br>
<p>Sets the runtime icon the system will use to represent the display window. All windows default to a simple pygame logo for the window icon. </p>
<p>You can pass any surface, but most systems want a smaller image around 32x32. The image can have colorkey transparency which will be passed to the system. </p>
<p>Some systems do not allow the window icon to change after it has been shown. This function can be called before <tt><a href="display.html#pygame.display.set_mode">pygame.display.set_mode</a> - <font size=-1>initialize a window or screen for display</font></tt> to create the icon before the display mode is set. </p>
<!--COMMENTS:pygame.display.set_icon--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.set_caption">
<big><b>pygame.display.set_caption</big></b><br><ul>
  <i>set the current window caption</i><br>
  <tt>pygame.display.set_caption(title, icontitle=None): return None</tt><br>
<p>If the display has a window title, this function will change the name on the window. Some systems support an alternate shorter title to be used for minimized displays. </p>
<!--COMMENTS:pygame.display.set_caption--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.get_caption">
<big><b>pygame.display.get_caption</big></b><br><ul>
  <i>get the current window caption</i><br>
  <tt>pygame.display.get_caption(): return (title, icontitle)</tt><br>
<p>Returns the title and icontitle for the display Surface. These will often be the same value. </p>
<!--COMMENTS:pygame.display.get_caption--> &nbsp;<br> 
<br></ul>


<a name="pygame.display.set_palette">
<big><b>pygame.display.set_palette</big></b><br><ul>
  <i>set the display color palette for indexed displays</i><br>
  <tt>pygame.display.set_palette(palette=None): return None</tt><br>
<p>This will change the video display color palette for 8bit displays. This does not change the palette for the actual display Surface, only the palette that is used to display the Surface. If no palette argument is passed, the system default palette will be restored. The palette is a sequence of <tt>RGB</tt> triplets. </p>
<!--COMMENTS:pygame.display.set_palette--> &nbsp;<br> 
<br></ul>
<br></ul>

</body></html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.