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

## Pygame Documentation

The pygame documentation is mainly generated automatically from the documentation. Each module and object in the package is broken into its own page in the reference documentation. The names of the objects are capitalized, while the regular module names are lower case.
The pygame documentation also comes with a full set of tutorials. You can find links to these tutorials and other documentation files below.

Basic Documentation
- Readme - Pygame Readme Information
- Install - Install Information
- LGPL - Gnu lesser general public license
- Logos - Pygame Logos
Tutorials / Introductions
- ChimpLineByLine - Line by Line Descriptions of the Chimp Example
- DisplayModes - Choosing and Configuring Display Modes
- Executable - Creating a Standalone Windows Executable
- ImportInit - Import and Initialize
- MoveIt - Help! How Do I Move An Image?
- SpriteIntro - Sprite Module Introduction
- SurfarrayIntro - Introduction to the surfarray module
- Newbieguide - A Newbie Guide To Pygame

Full Index

CD.eject - ejects cdrom drive
CD.get_all - get all track information for the cd
CD.get_busy - checks if the cd is currently playing
CD.get_current - get current position of the cdrom
CD.get_empty - checks for a cd in the drive
CD.get_id - get device id number for drive
CD.get_init - check if cd is initialized
CD.get_name - query name of cdrom drive
CD.get_numtracks - get number of tracks on cd
CD.get_paused - checks if the cd is currently paused
CD.get_track_audio - check if a track has audio data
CD.get_track_length - check the length of an audio track
CD.get_track_start - check the start of an audio track
CD.init - initialize a cdrom device for use
CD.pause - pause playing cdrom
CD.play - play music from cdrom
CD.quit - uninitialize a cdrom device for use
CD.resume - resume paused cdrom
CD.stop - stops playing cdrom
Channel.fadeout - fade out the channel
Channel.get_busy - query state of the channel
Channel.get_endevent - get the endevent for a channel
Channel.get_queue - get the currently queued sound object
Channel.get_sound - get the currently playing sound object
Channel.get_volume - query the volume for the
Channel.pause - temporarily stop the channel
Channel.play - play a sound on this channel
Channel.queue - queue a sound on this channel
Channel.set_endevent - set an endevent for a channel
Channel.set_volume - set volume for channel
Channel.stop - stop playing on the channel
Channel.unpause - restart a paused channel
Clock.get_fps - get the current rate of frames per second
Clock.get_rawtime - get number of nondelayed milliseconds between last two calls to tick()
Clock.get_time - get number of milliseconds between last two calls to tick()
Clock.tick - control timer events
Font.get_ascent - gets the font ascent
Font.get_bold - status of the bold attribute
Font.get_descent - gets the font descent
Font.get_height - average height of font glyph
Font.get_italic - status of the italic attribute
Font.get_linesize - gets the font recommended linesize
Font.get_underline - status of the underline attribute
Font.render - render text to a new image
Font.set_bold - assign the bold attribute
Font.set_italic - assign the italic attribute
Font.set_underline - assign the underline attribute
Font.size - size of rendered text
Joystick.get_axis - get the position of a joystick axis
Joystick.get_ball - get the movement of a joystick trackball
Joystick.get_button - get the position of a joystick button
Joystick.get_hat - get the position of a joystick hat
Joystick.get_id - get device id number for joystick
Joystick.get_init - check if joystick is initialized
Joystick.get_name - query name of joystick drive
Joystick.get_numaxes - get number of axes on a joystick
Joystick.get_numballs - get number of trackballs on a joystick
Joystick.get_numbuttons - get number of buttons on a joystick
Joystick.get_numhats - get number of hats on a joystick
Joystick.init - initialize a joystick device for use
Joystick.quit - uninitialize a joystick device for use
Movie.get_busy - query the playback state
Movie.get_frame - query the current frame in the movie
Movie.get_length - query playback time of the movie
Movie.get_size - query the size of the video image
Movie.get_time - query the current time in the movie
Movie.has_audio - query if movie stream has audio
Movie.has_video - query if movie stream has video
Movie.pause - pause/resume movie playback
Movie.play - start movie playback
Movie.render_frame - Render a specfic numbered frame.
Movie.rewind - set playback position to the beginning of the movie
Movie.set_display - change the video output surface
Movie.set_volume - change volume for sound
Movie.skip - skip the movie playback position forward
Movie.stop - stop movie playback
Rect.clamp - move rectangle inside another
Rect.clamp_ip - moves the rectangle inside another
Rect.clip - rectangle cropped inside another
Rect.collidedict - find overlapping rectangle in a dictionary
Rect.collidedictall - find all overlapping rectangles
Rect.collidelist - find overlapping rectangle
Rect.collidelistall - find all overlapping rectangles
Rect.collidepoint - point inside rectangle
Rect.colliderect - check overlapping rectangles
Rect.contains - check if rectangle fully inside another
Rect.inflate - new rectangle with size changed
Rect.inflate_ip - changes the Rect size
Rect.move - new rectangle with position changed
Rect.move_ip - move the Rect by the given offset
Rect.normalize - corrects negative sizes
Rect.union - makes new rectangle covering both inputs
Rect.union_ip - rectangle covering both input
Rect.unionall - rectangle covering all inputs
Rect.unionall_ip - rectangle covering all inputs
Sound.fadeout - fadeout all channels playing this sound
Sound.get_num_channels - number of channels with sound
Sound.get_volume - query volume for sound
Sound.play - play sound
Sound.set_volume - change volume for sound
Sound.stop - stop all channels playing this sound
Surface.blit - copy a one Surface to another.
Surface.convert - new copy of surface with different format
Surface.convert_alpha - new copy of surface with different format and per pixel alpha
Surface.fill - fill areas of a Surface
Surface.get_abs_offset - get absolute offset of subsurface
Surface.get_abs_parent - get the toplevel surface for a subsurface
Surface.get_alpha - query alpha information
Surface.get_at - get a pixel color
Surface.get_bitsize - query size of pixel
Surface.get_bytesize - query size of pixel
Surface.get_clip - query the clipping area
Surface.get_colorkey - query colorkey
Surface.get_flags - query the surface flags
Surface.get_height - query the surface height
Surface.get_locked - check if the surface needs locking
Surface.get_losses - get mapping losses for each colorplane
Surface.get_masks - get mapping bitmasks for each colorplane
Surface.get_offset - get offset of subsurface
Surface.get_palette - get the palette
Surface.get_palette_at - get a palette entry
Surface.get_parent - get a subsurface parent
Surface.get_pitch - query the surface pitch
Surface.get_rect - get a rectangle covering the entire surface
Surface.get_shifts - alphashift
Surface.get_size - query the surface size
Surface.get_width - query the surface width
Surface.lock - locks Surface for pixel access
Surface.map_rgb - convert RGB into a mapped color
Surface.mustlock - check if the surface needs locking
Surface.set_alpha - change alpha information
Surface.set_at - set pixel at given position
Surface.set_clip - assign destination clipping rectangle
Surface.set_colorkey - change colorkey information
Surface.set_palette - set the palette
Surface.set_palette_at - set a palette entry
Surface.subsurface - create a new surface that shares pixel data
Surface.unlock - locks Surface for pixel access
Surface.unmap_rgb - convert mapped color into RGB
pygame.Rect - create a new rectangle
pygame.Surface - create a new Surface
pygame.get_error - get current error message
pygame.init - autoinitialize all imported pygame modules
pygame.quit - uninitialize all pygame modules
pygame.register_quit - routine to call when pygame quits
pygame.cdrom.CD - create new CD object
pygame.cdrom.get_count - query number of cdroms on system
pygame.cdrom.get_init - query init of cdrom module
pygame.cdrom.init - initialize the cdrom subsystem
pygame.cdrom.quit - uninitialize the cdrom subsystem
pygame.constants.display - The following constants are used by the display module and Surfaces
pygame.constants.events - These constants define the various event types
pygame.constants.keyboard - These constants represent the keys on the keyboard.
pygame.constants.modifiers - These constants represent the modifier keys on the keyboard.
pygame.constants.zdepracated - The following constants are made available, but generally not needed
pygame.cursors.compile - compile cursor strings into cursor data
pygame.cursors.load_xbm - reads a pair of XBM files into set_cursor arguments
pygame.display.Info - get display capabilities and settings
pygame.display.flip - update the display
pygame.display.get_active - get state of display mode
pygame.display.get_caption - get the current title of the window
pygame.display.get_driver - get the current sdl video driver
pygame.display.get_init - get status of display module initialization
pygame.display.get_surface - get current display surface
pygame.display.gl_get_attribute - get special OPENGL attributes
pygame.display.gl_set_attribute - set special OPENGL attributes
pygame.display.iconify - minimize the display window
pygame.display.init - initialize the display module
pygame.display.list_modes - query all resolutions for requested mode
pygame.display.mode_ok - query a specific display mode
pygame.display.quit - uninitialize the display module
pygame.display.set_caption - changes the title of the window
pygame.display.set_gamma - change the brightness of the display
pygame.display.set_gamma_ramp - advanced control over the display gamma ramps
pygame.display.set_icon - changes the window manager icon for the window
pygame.display.set_mode - set the display mode
pygame.display.set_palette - set the palette
pygame.display.toggle_fullscreen - switch the display fullscreen mode
pygame.display.update - update an area of the display
pygame.draw.circle - draw a circle on a surface
pygame.draw.ellipse - draw an ellipse on a surface
pygame.draw.line - draw a line on a surface
pygame.draw.lines - draw multiple connected lines on a surface
pygame.draw.polygon - draws a polygon on a surface
pygame.draw.rect - draws a rectangle on a surface
pygame.event.Event - create new event object
pygame.event.clear - remove all of an event type from the queue
pygame.event.event_name - name for event type
pygame.event.get - get all of an event type from the queue
pygame.event.get_blocked - checks if an event is being blocked
pygame.event.get_grab - query the state of input grabbing
pygame.event.peek - query if any of event types are waiting
pygame.event.poll - get an available event
pygame.event.post - place an event on the queue
pygame.event.pump - update the internal messages
pygame.event.set_allowed - allows certain events onto the queue
pygame.event.set_blocked - blocks certain events from the queue
pygame.event.set_grab - grab all input events
pygame.event.wait - wait for an event
pygame.font.Font - create a new font object
pygame.font.get_default_font - get the name of the default font
pygame.font.get_init - get status of font module initialization
pygame.font.init - initialize the display module
pygame.font.quit - uninitialize the font module
pygame.image.fromstring - create a surface from a raw string buffer
pygame.image.get_extended - returns true if SDL_image formats are available
pygame.image.load - load an image to a new Surface
pygame.image.save - save surface data
pygame.image.tostring - create a raw string buffer of the surface data
pygame.joystick.Joystick - create new joystick object
pygame.joystick.get_count - query number of joysticks on system
pygame.joystick.get_init - query initialization of joystick module
pygame.joystick.init - initialize joystick module
pygame.joystick.quit - uninitialize joystick module
pygame.key.get_focused - state of keyboard focus
pygame.key.get_mods - get current state of modifier keys
pygame.key.get_pressed - get the pressed state for all keys
pygame.key.name - get the name of a key
pygame.key.set_mods - set the state of the modifier keys
pygame.key.set_repeat - change the keyboard repeat
pygame.mixer.Channel - get channel object
pygame.mixer.Sound - load a new soundfile
pygame.mixer.fadeout - fadeout all channels
pygame.mixer.find_channel - find an available sound channel
pygame.mixer.get_busy - query busy channels
pygame.mixer.get_init - query initialization for the mixer
pygame.mixer.get_num_channels - query the number of channels
pygame.mixer.init - initialize mixer module
pygame.mixer.pause - pause all channels
pygame.mixer.pre_init - presets the init default values
pygame.mixer.quit - unitializes the mixer
pygame.mixer.set_num_channels - sets the number of available channels
pygame.mixer.set_reserved - reserves first given channels
pygame.mixer.stop - stop all channels
pygame.mixer.unpause - restart any pause channels
pygame.mixer.music.fadeout - fadeout current music
pygame.mixer.music.get_busy - query state of the music
pygame.mixer.music.get_endevent - query the current music finished event
pygame.mixer.music.get_pos - query music position
pygame.mixer.music.get_volume - query music volume
pygame.mixer.music.load - load current music
pygame.mixer.music.pause - pause the playing music
pygame.mixer.music.play - play the current loaded music
pygame.mixer.music.queue - preload and queue a music file
pygame.mixer.music.rewind - restarts music
pygame.mixer.music.set_endevent - sets music finished event
pygame.mixer.music.set_volume - set music volume
pygame.mixer.music.stop - stop the playing music
pygame.mixer.music.unpause - restarts the paused music
pygame.mouse.get_cursor - get mouse cursor data
pygame.mouse.get_focused - state of mouse input focus
pygame.mouse.get_pos - gets the cursor position
pygame.mouse.get_pressed - state of the mouse buttons
pygame.mouse.get_rel - gets the movement of the mouse
pygame.mouse.set_cursor - state of shape of the mouse cursor
pygame.mouse.set_pos - moves the cursor position
pygame.mouse.set_visible - show or hide the mouse cursor
pygame.movie.Movie - load a new MPEG stream
pygame.sndarray.array - get an array copied from a sound
pygame.sndarray.make_sound - create a new Sound object from array data
pygame.sndarray.samples - get a reference to the sound samples
pygame.sprite.Group.add - add sprite to group
pygame.sprite.Group.copy - copy a group with all the same sprites
pygame.sprite.Group.empty - remove all sprites
pygame.sprite.Group.has - ask if group has sprite
pygame.sprite.Group.remove - remove sprite from group
pygame.sprite.Group.sprites - return an object to loop over each sprite
pygame.sprite.Group.update - call update for all member sprites
pygame.sprite.Group - (class) - the Group class is a container for sprites
pygame.sprite.GroupSingle - (class) - a group container that holds a single most recent item
pygame.sprite.RenderClear.clear - erase the previous position of all sprites
pygame.sprite.RenderClear.draw - draw all sprites onto a surface
pygame.sprite.RenderClear - (class) - a group container that can draw and clear its sprites
pygame.sprite.RenderPlain.draw - draw all sprites onto a surface
pygame.sprite.RenderPlain - (class) - a sprite group that can draw all its sprites
pygame.sprite.RenderUpdates.draw - draw all sprites onto the surface
pygame.sprite.RenderUpdates - (class) - a sprite group that can draw and clear with update rectangles
pygame.sprite.Sprite.add - add a sprite to container
pygame.sprite.Sprite.alive - ask the life of a sprite
pygame.sprite.Sprite.groups - list used sprite containers
pygame.sprite.Sprite.kill - end life of sprite, remove from all groups
pygame.sprite.Sprite.remove - remove a sprite from container
pygame.sprite.Sprite - (class) - the base class for your visible game objects.
pygame.sprite.groupcollide - collision detection between group and group
pygame.sprite.spritecollide - collision detection between sprite and group
pygame.sprite.spritecollideany - finds any sprites that collide
pygame.surfarray.array2d - get a 2d array copied from a surface
pygame.surfarray.array3d - get a 3d array copied from a surface
pygame.surfarray.array_alpha - get an array with a surface pixel alpha values
pygame.surfarray.array_colorkey - get an array with a surface colorkey values
pygame.surfarray.blit_array - quickly transfer an array to a Surface
pygame.surfarray.make_surface - create a new Surface from array data
pygame.surfarray.map_array - map an array with RGB values into mapped colors
pygame.surfarray.pixels2d - get a 2d reference array to a surface
pygame.surfarray.pixels3d - get a 3d reference array to a surface
pygame.surfarray.pixels_alpha - get a reference array to a surface alpha data
pygame.time.Clock - create a new clock
pygame.time.delay - accurately delay for a number of milliseconds
pygame.time.get_ticks - milliseconds since initialization
pygame.time.set_timer - control timer events
pygame.time.wait - yielding delay for a number of milliseconds
pygame.transform.flip - flips a surface on either axis
pygame.transform.rotate - rotate a Surface
pygame.transform.rotozoom - smoothly scale and/or rotate an image
pygame.transform.scale2x - doubles the size of the image with advanced scaling
pygame.transform.scale - scale a Surface to an arbitrary size