Mercurial > pygame
changeset 3183:e90984429fb0
Merged in takluyver/pygame/docs-changes (pull request #19: More changes to the docs)
| author | illume <renesd@gmail.com> |
|---|---|
| date | Thu, 10 Jan 2013 14:49:00 +0100 |
| parents | 8491d045ee02 (current diff) 0c07af110477 (diff) |
| children | 4a4611239021 |
| files | docs/_sources/filepaths.txt docs/_sources/index.txt docs/_sources/ref/camera.txt docs/_sources/ref/cdrom.txt docs/_sources/ref/color.txt docs/_sources/ref/cursors.txt docs/_sources/ref/display.txt docs/_sources/ref/draw.txt docs/_sources/ref/event.txt docs/_sources/ref/examples.txt docs/_sources/ref/font.txt docs/_sources/ref/freetype.txt docs/_sources/ref/gfxdraw.txt docs/_sources/ref/image.txt docs/_sources/ref/joystick.txt docs/_sources/ref/key.txt docs/_sources/ref/locals.txt docs/_sources/ref/mask.txt docs/_sources/ref/math.txt docs/_sources/ref/midi.txt docs/_sources/ref/mixer.txt docs/_sources/ref/mouse.txt docs/_sources/ref/movie.txt docs/_sources/ref/music.txt docs/_sources/ref/overlay.txt docs/_sources/ref/pixelarray.txt docs/_sources/ref/pixelcopy.txt docs/_sources/ref/pygame.txt docs/_sources/ref/rect.txt docs/_sources/ref/scrap.txt docs/_sources/ref/sndarray.txt docs/_sources/ref/sprite.txt docs/_sources/ref/surface.txt docs/_sources/ref/surfarray.txt docs/_sources/ref/tests.txt docs/_sources/ref/time.txt docs/_sources/ref/transform.txt docs/_static/ajax-loader.gif docs/_static/basic.css docs/_static/comment-bright.png docs/_static/comment-close.png docs/_static/comment.png docs/_static/doctools.js docs/_static/down-pressed.png docs/_static/down.png docs/_static/file.png docs/_static/jquery.js docs/_static/minus.png docs/_static/plus.png docs/_static/pygame.css docs/_static/pygame.ico docs/_static/pygame_tiny.png docs/_static/pygments.css docs/_static/reset.css docs/_static/searchtools.js docs/_static/tooltip.css docs/_static/underscore.js docs/_static/up-pressed.png docs/_static/up.png docs/_static/websupport.js docs/filepaths.html docs/genindex.html docs/index.html docs/ref/camera.html docs/ref/cdrom.html docs/ref/color.html docs/ref/cursors.html docs/ref/display.html docs/ref/draw.html docs/ref/event.html docs/ref/examples.html docs/ref/font.html docs/ref/freetype.html docs/ref/gfxdraw.html docs/ref/image.html docs/ref/joystick.html docs/ref/key.html docs/ref/locals.html docs/ref/mask.html docs/ref/math.html docs/ref/midi.html docs/ref/mixer.html docs/ref/mouse.html docs/ref/movie.html docs/ref/music.html docs/ref/overlay.html docs/ref/pixelarray.html docs/ref/pixelcopy.html docs/ref/pygame.html docs/ref/rect.html docs/ref/scrap.html docs/ref/sndarray.html docs/ref/sprite.html docs/ref/surface.html docs/ref/surfarray.html docs/ref/tests.html docs/ref/time.html docs/ref/transform.html docs/search.html docs/searchindex.js docs/tut/SpriteIntro.html docs/tut/newbieguide.html |
| diffstat | 105 files changed, 16 insertions(+), 32469 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Wed Jan 09 19:26:26 2013 +0100 +++ b/.hgignore Thu Jan 10 14:49:00 2013 +0100 @@ -7,3 +7,13 @@ docs/\.buildinfo docs/objects.inv docs/doctrees/* +docs/_sources +docs/_static +docs/genindex.html +docs/search.html +docs/searchindex.js +docs/tut/newbieguide.html +docs/filepaths.html +docs/index.html +docs/ref/*.html +docs/tut/SpriteIntro.html
--- a/docs/_sources/filepaths.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -File Path Function Arguments -============================ - -File Path Function Arguments ----------------------------- - - A Pygame function or method which takes a file path argument - will accept either an Unicode or a byte — 8-bit or ASCII character — string. - Unicode strings are translated to Python's default file system encoding, - as returned by sys.getfilesystemencoding(). - An Unicode code point above U+FFFF — '\uFFFF' — can - be coded directly with a 32-bit escape - sequences — '\Uxxxxxxxx' — , - even for Python interpreters built with an UCS-2 (16-bit character) unicode type. - Byte strings are passed to the operating system unchanged. - - Null characters — '\x00' — - are not permitted in the path, raising an exception. - An exception is also raised if an Unicode file path cannot be encoded. - How UTF-16 surrogate codes are handled is Python interpreter dependent. - Use UTF-32 code points and 32-bit escape sequences instead. - The exception types are function dependent.
--- a/docs/_sources/index.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -.. Pygame documentation master file, created by - sphinx-quickstart on Sat Mar 5 11:56:39 2011. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Pygame Front Page -================= - -.. toctree:: - :maxdepth: 2 - :glob: - :hidden: - - ref/* - filepaths - -Documents ---------- - -`Readme`_ - Basic information about Pygame, what it is, who is involved, and where to find it. - -`Install`_ - Steps needed to compile Pygame on several platforms. - Also help on finding and installing prebuilt binaries for your system. - -`File Path Function Arguments`_ - How Pygame handles file system paths. - -`LGPL License`_ - This is the license Pygame is distributed under. - It provides for Pygame to be distributed with open source and commercial software. - Generally, if Pygame is not changed, it can be used with any type of program. - -Tutorials ---------- - -`Introduction to Pygame`_ - An introduction to the basics of Pygame. - This is written for users of Python and appeared in volume two of the Py magazine. - -`Import and Initialize`_ - The beginning steps on importing and initializing Pygame. - The Pygame package is made of several modules. - Some modules are not included on all platforms. - -`How do I move an Image?`_ - A basic tutorial that covers the concepts behind 2D computer animation. - Information about drawing and clearing objects to make them appear animated. - -`Chimp Tutorial, Line by Line`_ - The pygame examples include a simple program with an interactive fist and a chimpanzee. - This was inspired by the annoying flash banner of the early 2000's. - This tutorial examines every line of coded used in the example. - -`Sprite Module Introduction`_ - Pygame includes a higher level sprite module to help organize games. - The sprite module includes several classes that help manage details found in almost all games types. - The Sprite classes are a bit more advanced than the regular Pygame modules, - and need more understanding to be properly used. - -`Surfarray Introduction`_ - Pygame used the Numpy python module to allow efficient per pixel effects on images. - Using the surfae arrays is an advanced feature that allows custom effects and filters. - This also examines some of the simple effects from the Pygame example, arraydemo.py. - -`Camera Module Introduction`_ - Pygame, as of 1.9, has a camera module that allows you to capture images, - watch live streams, and do some basic computer vision. - This tutorial covers those use cases. - -`Newbie Guide`_ - A list of thirteen helpful tips for people to get comfortable using Pygame. - -`Making Games Tutorial`_ - A large tutorial that covers the bigger topics needed to create an entire game. - -Reference ---------- - -:ref:`genindex` - A list of all functions, classes, and methods in the Pygame package. - -:doc:`ref/cdrom` - How to access and control the CD audio devices. - -:doc:`ref/color` - Color representation. - -:doc:`ref/cursors` - Loading and compiling cursor images. - -:doc:`ref/display` - Configure the display surface. - -:doc:`ref/draw` - Drawing simple shapes like lines and ellipses to surfaces. - -:doc:`ref/event` - Manage the incoming events from various input devices and the windowing platform. - -:doc:`ref/examples` - Various programs demonstrating the use of individual pyame modules. - -:doc:`ref/font` - Loading and rendering Truetype fonts. - -:doc:`ref/freetype` - Enhanced Pygame module for loading and rendering font faces. - -:doc:`ref/gfxdraw` - Anti-aliasing draw functions. - -:doc:`ref/image` - Loading, saving, and transferring of surfaces. - -:doc:`ref/joystick` - Manage the joystick devices. - -:doc:`ref/key` - Manage the keyboard device. - -:doc:`ref/locals` - Pygame constants. - -:doc:`ref/mixer` - Load and play sounds - -:doc:`ref/mouse` - Manage the mouse device and display. - -:doc:`ref/movie` - Video playback from MPEG movies. - -:doc:`ref/music` - Play streaming music tracks. - -:doc:`ref/overlay` - Access advanced video overlays. - -:doc:`ref/pygame` - Top level functions to manage Pygame. - -:doc:`ref/pixelarray` - Manipulate image pixel data. - -:doc:`ref/rect` - Flexible container for a rectangle. - -:doc:`ref/scrap` - Native clipboard access. - -:doc:`ref/sndarray` - Manipulate sound sample data. - -:doc:`ref/sprite` - Higher level objects to represent game images. - -:doc:`ref/surface` - Objects for images and the screen. - -:doc:`ref/surfarray` - Manipulate image pixel data. - -:doc:`ref/tests` - Test Pygame. - -:doc:`ref/time` - Manage timing and framerate. - -:doc:`ref/transform` - Resize and move images. - -:ref:`search` - Search Pygame documents by keyword. - -.. _Readme: ../readme.html - -.. _Install: ../install.html - -.. _File Path Function Arguments: filepaths.html - -.. _LGPL License: ../LGPL - -.. _Introduction to Pygame: tut/intro/intro.html - -.. _Import and Initialize: tut/ImportInit.html - -.. _How do I move an Image?: tut/MoveIt.html - -.. _Chimp Tutorial, Line by Line: tut/chimp/ChimpLineByLine.html - -.. _Sprite Module Introduction: tut/SpriteIntro.html - -.. _Surfarray Introduction: tut/surfarray/SurfarrayIntro.html - -.. _Camera Module Introduction: tut/camera/CameraIntro.html - -.. _Newbie Guide: tut/newbieguide.html - -.. _Making Games Tutorial: tut/tom/MakeGames.html
--- a/docs/_sources/ref/camera.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.camera` -==================== - -.. module:: pygame.camera - :synopsis: pygame module for camera use - -| :sl:`pygame module for camera use` - -Pygame currently supports only Linux and v4l2 cameras. - -EXPERIMENTAL!: This api may change or disappear in later pygame releases. If -you use this, your code will very likely break with the next pygame release. - -The Bayer to ``RGB`` function is based on: - -:: - - Sonix SN9C101 based webcam basic I/F routines - Copyright (C) 2004 Takafumi Mizuno <taka-qce@ls-a.jp> - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -New in pygame 1.9.0. - -.. function:: colorspace - - | :sl:`Surface colorspace conversion` - | :sg:`colorspace(Surface, format, DestSurface = None) -> Surface` - - Allows for conversion from "RGB" to a destination colorspace of "HSV" or - "YUV". The source and destination surfaces must be the same size and pixel - depth. This is useful for computer vision on devices with limited processing - power. Capture as small of an image as possible, ``transform.scale()`` it - even smaller, and then convert the colorspace to ``YUV`` or ``HSV`` before - doing any processing on it. - - .. ## pygame.camera.colorspace ## - -.. function:: list_cameras - - | :sl:`returns a list of available cameras` - | :sg:`list_cameras() -> [cameras]` - - Checks the computer for available cameras and returns a list of strings of - camera names, ready to be fed into :class:`pygame.camera.Camera`. - - .. ## pygame.camera.list_cameras ## - -.. class:: Camera - - | :sl:`load a camera` - | :sg:`Camera(device, (width, height), format) -> Camera` - - Loads a v4l2 camera. The device is typically something like "/dev/video0". - Default width and height are 640 by 480. Format is the desired colorspace of - the output. This is useful for computer vision purposes. The default is - ``RGB``. The following are supported: - - * ``RGB`` - Red, Green, Blue - - * ``YUV`` - Luma, Blue Chrominance, Red Chrominance - - * ``HSV`` - Hue, Saturation, Value - - .. method:: start - - | :sl:`opens, initializes, and starts capturing` - | :sg:`start() -> None` - - Opens the camera device, attempts to initialize it, and begins recording - images to a buffer. The camera must be started before any of the below - functions can be used. - - .. ## Camera.start ## - - .. method:: stop - - | :sl:`stops, uninitializes, and closes the camera` - | :sg:`stop() -> None` - - Stops recording, uninitializes the camera, and closes it. Once a camera - is stopped, the below functions cannot be used until it is started again. - - .. ## Camera.stop ## - - .. method:: get_controls - - | :sl:`gets current values of user controls` - | :sg:`get_controls() -> (hflip = bool, vflip = bool, brightness)` - - If the camera supports it, get_controls will return the current settings - for horizontal and vertical image flip as bools and brightness as an int. - If unsupported, it will return the default values of (0, 0, 0). Note that - the return values here may be different than those returned by - set_controls, though these are more likely to be correct. - - .. ## Camera.get_controls ## - - .. method:: set_controls - - | :sl:`changes camera settings if supported by the camera` - | :sg:`set_controls(hflip = bool, vflip = bool, brightness) -> (hflip = bool, vflip = bool, brightness)` - - Allows you to change camera settings if the camera supports it. The - return values will be the input values if the camera claims it succeeded - or the values previously in use if not. Each argument is optional, and - the desired one can be chosen by supplying the keyword, like hflip. Note - that the actual settings being used by the camera may not be the same as - those returned by set_controls. - - .. ## Camera.set_controls ## - - .. method:: get_size - - | :sl:`returns the dimensions of the images being recorded` - | :sg:`get_size() -> (width, height)` - - Returns the current dimensions of the images being captured by the - camera. This will return the actual size, which may be different than the - one specified during initialization if the camera did not support that - size. - - .. ## Camera.get_size ## - - .. method:: query_image - - | :sl:`checks if a frame is ready` - | :sg:`query_image() -> bool` - - If an image is ready to get, it returns true. Otherwise it returns false. - Note that some webcams will always return False and will only queue a - frame when called with a blocking function like ``get_image()``. This is - useful to separate the framerate of the game from that of the camera - without having to use threading. - - .. ## Camera.query_image ## - - .. method:: get_image - - | :sl:`captures an image as a Surface` - | :sg:`get_image(Surface = None) -> Surface` - - Pulls an image off of the buffer as an ``RGB`` Surface. It can optionally - reuse an existing Surface to save time. The bit depth of the surface is - either 24bits or the same as the optionally supplied Surface. - - .. ## Camera.get_image ## - - .. method:: get_raw - - | :sl:`returns an unmodified image as a string` - | :sg:`get_raw() -> string` - - Gets an image from a camera as a string in the native pixelformat of the - camera. Useful for integration with other libraries. - - .. ## Camera.get_raw ## - - .. ## pygame.camera.Camera ## - -.. ## pygame.camera ##
--- a/docs/_sources/ref/cdrom.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,305 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.cdrom` -=================== - -.. module:: pygame.cdrom - :synopsis: pygame module for audio cdrom control - -| :sl:`pygame module for audio cdrom control` - -The cdrom module manages the ``CD`` and ``DVD`` drives on a computer. It can -also control the playback of audio cd's. This module needs to be initialized -before it can do anything. Each ``CD`` object you create represents a cdrom -drive and must also be initialized individually before it can do most things. - -.. function:: init - - | :sl:`initialize the cdrom module` - | :sg:`init() -> None` - - Initialize the cdrom module. This will scan the system for all ``CD`` - devices. The module must be initialized before any other functions will - work. This automatically happens when you call ``pygame.init()``. - - It is safe to call this function more than once. - - .. ## pygame.cdrom.init ## - -.. function:: quit - - | :sl:`uninitialize the cdrom module` - | :sg:`quit() -> None` - - Uninitialize the cdrom module. After you call this any existing ``CD`` - objects will no longer work. - - It is safe to call this function more than once. - - .. ## pygame.cdrom.quit ## - -.. function:: get_init - - | :sl:`true if the cdrom module is initialized` - | :sg:`get_init() -> bool` - - Test if the cdrom module is initialized or not. This is different than the - ``CD.init()`` since each drive must also be initialized individually. - - .. ## pygame.cdrom.get_init ## - -.. function:: get_count - - | :sl:`number of cd drives on the system` - | :sg:`get_count() -> count` - - Return the number of cd drives on the system. When you create ``CD`` objects - you need to pass an integer id that must be lower than this count. The count - will be 0 if there are no drives on the system. - - .. ## pygame.cdrom.get_count ## - -.. class:: CD - - | :sl:`class to manage a cdrom drive` - | :sg:`CD(id) -> CD` - - You can create a ``CD`` object for each cdrom on the system. Use - ``pygame.cdrom.get_count()`` to determine how many drives actually exist. - The id argument is an integer of the drive, starting at zero. - - The ``CD`` object is not initialized, you can only call ``CD.get_id()`` and - ``CD.get_name()`` on an uninitialized drive. - - It is safe to create multiple ``CD`` objects for the same drive, they will - all cooperate normally. - - .. method:: init - - | :sl:`initialize a cdrom drive for use` - | :sg:`init() -> None` - - Initialize the cdrom drive for use. The drive must be initialized for - most ``CD`` methods to work. Even if the rest of pygame has been - initialized. - - There may be a brief pause while the drive is initialized. Avoid - ``CD.init()`` if the program should not stop for a second or two. - - .. ## CD.init ## - - .. method:: quit - - | :sl:`uninitialize a cdrom drive for use` - | :sg:`quit() -> None` - - Uninitialize a drive for use. Call this when your program will not be - accessing the drive for awhile. - - .. ## CD.quit ## - - .. method:: get_init - - | :sl:`true if this cd device initialized` - | :sg:`get_init() -> bool` - - Test if this ``CDROM`` device is initialized. This is different than the - ``pygame.cdrom.init()`` since each drive must also be initialized - individually. - - .. ## CD.get_init ## - - .. method:: play - - | :sl:`start playing audio` - | :sg:`play(track, start=None, end=None) -> None` - - Playback audio from an audio cdrom in the drive. Besides the track number - argument, you can also pass a starting and ending time for playback. The - start and end time are in seconds, and can limit the section of an audio - track played. - - If you pass a start time but no end, the audio will play to the end of - the track. If you pass a start time and 'None' for the end time, the - audio will play to the end of the entire disc. - - See the ``CD.get_numtracks()`` and ``CD.get_track_audio()`` to find - tracks to playback. - - Note, track 0 is the first track on the ``CD``. Track numbers start at - zero. - - .. ## CD.play ## - - .. method:: stop - - | :sl:`stop audio playback` - | :sg:`stop() -> None` - - Stops playback of audio from the cdrom. This will also lose the current - playback position. This method does nothing if the drive isn't already - playing audio. - - .. ## CD.stop ## - - .. method:: pause - - | :sl:`temporarily stop audio playback` - | :sg:`pause() -> None` - - Temporarily stop audio playback on the ``CD``. The playback can be - resumed at the same point with the ``CD.resume()`` method. If the ``CD`` - is not playing this method does nothing. - - Note, track 0 is the first track on the ``CD``. Track numbers start at - zero. - - .. ## CD.pause ## - - .. method:: resume - - | :sl:`unpause audio playback` - | :sg:`resume() -> None` - - Unpause a paused ``CD``. If the ``CD`` is not paused or already playing, - this method does nothing. - - .. ## CD.resume ## - - .. method:: eject - - | :sl:`eject or open the cdrom drive` - | :sg:`eject() -> None` - - This will open the cdrom drive and eject the cdrom. If the drive is - playing or paused it will be stopped. - - .. ## CD.eject ## - - .. method:: get_id - - | :sl:`the index of the cdrom drive` - | :sg:`get_id() -> id` - - Returns the integer id that was used to create the ``CD`` instance. This - method can work on an uninitialized ``CD``. - - .. ## CD.get_id ## - - .. method:: get_name - - | :sl:`the system name of the cdrom drive` - | :sg:`get_name() -> name` - - Return the string name of the drive. This is the system name used to - represent the drive. It is often the drive letter or device name. This - method can work on an uninitialized ``CD``. - - .. ## CD.get_name ## - - .. method:: get_busy - - | :sl:`true if the drive is playing audio` - | :sg:`get_busy() -> bool` - - Returns True if the drive busy playing back audio. - - .. ## CD.get_busy ## - - .. method:: get_paused - - | :sl:`true if the drive is paused` - | :sg:`get_paused() -> bool` - - Returns True if the drive is currently paused. - - .. ## CD.get_paused ## - - .. method:: get_current - - | :sl:`the current audio playback position` - | :sg:`get_current() -> track, seconds` - - Returns both the current track and time of that track. This method works - when the drive is either playing or paused. - - Note, track 0 is the first track on the ``CD``. Track numbers start at - zero. - - .. ## CD.get_current ## - - .. method:: get_empty - - | :sl:`False if a cdrom is in the drive` - | :sg:`get_empty() -> bool` - - Return False if there is a cdrom currently in the drive. If the drive is - empty this will return True. - - .. ## CD.get_empty ## - - .. method:: get_numtracks - - | :sl:`the number of tracks on the cdrom` - | :sg:`get_numtracks() -> count` - - Return the number of tracks on the cdrom in the drive. This will return - zero of the drive is empty or has no tracks. - - .. ## CD.get_numtracks ## - - .. method:: get_track_audio - - | :sl:`true if the cdrom track has audio data` - | :sg:`get_track_audio(track) -> bool` - - Determine if a track on a cdrom contains audio data. You can also call - ``CD.num_tracks()`` and ``CD.get_all()`` to determine more information - about the cdrom. - - Note, track 0 is the first track on the ``CD``. Track numbers start at - zero. - - .. ## CD.get_track_audio ## - - .. method:: get_all - - | :sl:`get all track information` - | :sg:`get_all() -> [(audio, start, end, lenth), ...]` - - Return a list with information for every track on the cdrom. The - information consists of a tuple with four values. The audio value is True - if the track contains audio data. The start, end, and length values are - floating point numbers in seconds. Start and end represent absolute times - on the entire disc. - - .. ## CD.get_all ## - - .. method:: get_track_start - - | :sl:`start time of a cdrom track` - | :sg:`get_track_start(track) -> seconds` - - Return the absolute time in seconds where at start of the cdrom track. - - Note, track 0 is the first track on the ``CD``. Track numbers start at - zero. - - .. ## CD.get_track_start ## - - .. method:: get_track_length - - | :sl:`length of a cdrom track` - | :sg:`get_track_length(track) -> seconds` - - Return a floating point value in seconds of the length of the cdrom - track. - - Note, track 0 is the first track on the ``CD``. Track numbers start at - zero. - - .. ## CD.get_track_length ## - - .. ## pygame.cdrom.CD ## - -.. ## pygame.cdrom ##
--- a/docs/_sources/ref/color.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.Color` -=================== - -.. currentmodule:: pygame - -.. class:: Color - - | :sl:`pygame object for color representations` - | :sg:`Color(name) -> Color` - | :sg:`Color(r, g, b, a) -> Color` - | :sg:`Color(rgbvalue) -> Color` - - The Color class represents ``RGBA`` color values using a value range of - 0-255. It allows basic arithmetic operations to create new colors, supports - conversions to other color spaces such as ``HSV`` or ``HSL`` and lets you - adjust single color channels. Alpha defaults to 255 when not given. - - 'rgbvalue' can be either a color name, an ``HTML`` color format string, a - hex number string, or an integer pixel value. The ``HTML`` format is - '#rrggbbaa', where rr, gg, bb, and aa are 2 digit hex numbers. The alpha aa - is optional. A hex number string has the form '0xrrggbbaa', where aa is - optional. - - Color objects support equality comparison with other color objects and 3 or - 4 element tuples of integers (New in 1.9.0). There was a bug in pygame 1.8.1 - where the default alpha was 0, not 255 like previously. - - New implementation of Color was done in pygame 1.8.1. - - .. attribute:: r - - | :sl:`Gets or sets the red value of the Color.` - | :sg:`r -> int` - - The red value of the Color. - - .. ## Color.r ## - - .. attribute:: g - - | :sl:`Gets or sets the green value of the Color.` - | :sg:`g -> int` - - The green value of the Color. - - .. ## Color.g ## - - .. attribute:: b - - | :sl:`Gets or sets the blue value of the Color.` - | :sg:`b -> int` - - The blue value of the Color. - - .. ## Color.b ## - - .. attribute:: a - - | :sl:`Gets or sets the alpha value of the Color.` - | :sg:`a -> int` - - The alpha value of the Color. - - .. ## Color.a ## - - .. attribute:: cmy - - | :sl:`Gets or sets the CMY representation of the Color.` - | :sg:`cmy -> tuple` - - The ``CMY`` representation of the Color. The ``CMY`` components are in - the ranges ``C`` = [0, 1], ``M`` = [0, 1], ``Y`` = [0, 1]. Note that this - will not return the absolutely exact ``CMY`` values for the set ``RGB`` - values in all cases. Due to the ``RGB`` mapping from 0-255 and the - ``CMY`` mapping from 0-1 rounding errors may cause the ``CMY`` values to - differ slightly from what you might expect. - - .. ## Color.cmy ## - - .. attribute:: hsva - - | :sl:`Gets or sets the HSVA representation of the Color.` - | :sg:`hsva -> tuple` - - The ``HSVA`` representation of the Color. The ``HSVA`` components are in - the ranges ``H`` = [0, 360], ``S`` = [0, 100], ``V`` = [0, 100], A = [0, - 100]. Note that this will not return the absolutely exact ``HSV`` values - for the set ``RGB`` values in all cases. Due to the ``RGB`` mapping from - 0-255 and the ``HSV`` mapping from 0-100 and 0-360 rounding errors may - cause the ``HSV`` values to differ slightly from what you might expect. - - .. ## Color.hsva ## - - .. attribute:: hsla - - | :sl:`Gets or sets the HSLA representation of the Color.` - | :sg:`hsla -> tuple` - - The ``HSLA`` representation of the Color. The ``HSLA`` components are in - the ranges ``H`` = [0, 360], ``S`` = [0, 100], ``V`` = [0, 100], A = [0, - 100]. Note that this will not return the absolutely exact ``HSL`` values - for the set ``RGB`` values in all cases. Due to the ``RGB`` mapping from - 0-255 and the ``HSL`` mapping from 0-100 and 0-360 rounding errors may - cause the ``HSL`` values to differ slightly from what you might expect. - - .. ## Color.hsla ## - - .. attribute:: i1i2i3 - - | :sl:`Gets or sets the I1I2I3 representation of the Color.` - | :sg:`i1i2i3 -> tuple` - - The ``I1I2I3`` representation of the Color. The ``I1I2I3`` components are - in the ranges ``I1`` = [0, 1], ``I2`` = [-0.5, 0.5], ``I3`` = [-0.5, - 0.5]. Note that this will not return the absolutely exact ``I1I2I3`` - values for the set ``RGB`` values in all cases. Due to the ``RGB`` - mapping from 0-255 and the ``I1I2I3`` mapping from 0-1 rounding errors - may cause the ``I1I2I3`` values to differ slightly from what you might - expect. - - .. ## Color.i1i2i3 ## - - .. method:: normalize - - | :sl:`Returns the normalized RGBA values of the Color.` - | :sg:`normalize() -> tuple` - - Returns the normalized ``RGBA`` values of the Color as floating point - values. - - .. ## Color.normalize ## - - .. method:: correct_gamma - - | :sl:`Applies a certain gamma value to the Color.` - | :sg:`correct_gamma (gamma) -> Color` - - Applies a certain gamma value to the Color and returns a new Color with - the adjusted ``RGBA`` values. - - .. ## Color.correct_gamma ## - - .. method:: set_length - - | :sl:`Set the number of elements in the Color to 1,2,3, or 4.` - | :sg:`set_length(len) -> None` - - The default Color length is 4. Colors can have lengths 1,2,3 or 4. This - is useful if you want to unpack to r,g,b and not r,g,b,a. If you want to - get the length of a Color do ``len(acolor)``. - - New in pygame 1.9.0. - - .. ## Color.set_length ## - - .. ## pygame.Color ##
--- a/docs/_sources/ref/cursors.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.cursors` -===================== - -.. module:: pygame.cursors - :synopsis: pygame module for cursor resources - -| :sl:`pygame module for cursor resources` - -Pygame offers control over the system hardware cursor. Pygame only supports -black and white cursors for the system. You control the cursor with functions -inside :mod:`pygame.mouse`. - -This cursors module contains functions for loading and unencoding various -cursor formats. These allow you to easily store your cursors in external files -or directly as encoded python strings. - -The module includes several standard cursors. The ``pygame.mouse.set_cursor()`` -function takes several arguments. All those arguments have been stored in a -single tuple you can call like this: - -:: - - >>> pygame.mouse.set_cursor(*pygame.cursors.arrow) - -This module also contains a few cursors as formatted strings. You'll need to -pass these to ``pygame.cursors.compile()`` function before you can use them. -The example call would look like this: - -:: - - >>> cursor = pygame.cursors.compile(pygame.cursors.textmarker_strings) - >>> pygame.mouse.set_cursor(*cursor) - -The following variables are cursor bitmaps that can be used as cursor: - - * ``pygame.cursors.arrow`` - - * ``pygame.cursors.diamond`` - - * ``pygame.cursors.broken_x`` - - * ``pygame.cursors.tri_left`` - - * ``pygame.cursors.tri_right`` - -The following strings can be converted into cursor bitmaps with -``pygame.cursors.compile()`` : - - * ``pygame.cursors.thickarrow_strings`` - - * ``pygame.cursors.sizer_x_strings`` - - * ``pygame.cursors.sizer_y_strings`` - - * ``pygame.cursors.sizer_xy_strings`` - -.. function:: compile - - | :sl:`create binary cursor data from simple strings` - | :sg:`compile(strings, black='X', white='.', xor='o') -> data, mask` - - A sequence of strings can be used to create binary cursor data for the - system cursor. The return values are the same format needed by - ``pygame.mouse.set_cursor()``. - - If you are creating your own cursor strings, you can use any value represent - the black and white pixels. Some system allow you to set a special toggle - color for the system color, this is also called the xor color. If the system - does not support xor cursors, that color will simply be black. - - The width of the strings must all be equal and be divisible by 8. An example - set of cursor strings looks like this - - :: - - thickarrow_strings = ( #sized 24x24 - "XX ", - "XXX ", - "XXXX ", - "XX.XX ", - "XX..XX ", - "XX...XX ", - "XX....XX ", - "XX.....XX ", - "XX......XX ", - "XX.......XX ", - "XX........XX ", - "XX........XXX ", - "XX......XXXXX ", - "XX.XXX..XX ", - "XXXX XX..XX ", - "XX XX..XX ", - " XX..XX ", - " XX..XX ", - " XX..XX ", - " XXXX ", - " XX ", - " ", - " ", - " ") - - .. ## pygame.cursors.compile ## - -.. function:: load_xbm - - | :sl:`load cursor data from an xbm file` - | :sg:`load_xbm(cursorfile) -> cursor_args` - | :sg:`load_xbm(cursorfile, maskfile) -> cursor_args` - - This loads cursors for a simple subset of ``XBM`` files. ``XBM`` files are - traditionally used to store cursors on unix systems, they are an ascii - format used to represent simple images. - - Sometimes the black and white color values will be split into two separate - ``XBM`` files. You can pass a second maskfile argument to load the two - images into a single cursor. - - The cursorfile and maskfile arguments can either be filenames or filelike - object with the readlines method. - - The return value cursor_args can be passed directly to the - ``pygame.mouse.set_cursor()`` function. - - .. ## pygame.cursors.load_xbm ## - -.. ## pygame.cursors ##
--- a/docs/_sources/ref/display.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,441 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.display` -===================== - -.. module:: pygame.display - :synopsis: pygame module to control the display window and screen - -| :sl:`pygame module to control the display window and screen` - -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. - -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. - -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 ``pygame.display.set_mode()``. - -Pygame can only have a single display active at any time. Creating a new one -with ``pygame.display.set_mode()`` will close the previous display. If precise -control is needed over the pixel format or display resolutions, use the -functions ``pygame.display.mode_ok()``, ``pygame.display.list_modes()``, and -``pygame.display.Info()`` to query information about the display. - -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. - -Then the display mode is set, several events are placed on the pygame event -queue. ``pygame.QUIT`` is sent when the user has requested the program to -shutdown. The window will receive ``pygame.ACTIVEEVENT`` events as the display -gains and loses input focus. If the display is set with the -``pygame.RESIZABLE`` flag, ``pygame.VIDEORESIZE`` events will be sent when the -user adjusts the window dimensions. Hardware displays that draw direct to the -screen will get ``pygame.VIDEOEXPOSE`` events when portions of the window must -be redrawn. - -.. function:: init - - | :sl:`initialize the display module` - | :sg:`init() -> None` - - 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 ``pygame.init()``. - - 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 ``SDL_VIDEODRIVER`` can be set to control which backend - is used. The systems with multiple choices are listed here. - - :: - - Windows : windib, directx - Unix : x11, dga, fbcon, directfb, ggi, vgl, svgalib, aalib - - On some platforms it is possible to embed the pygame display into an already - existing window. To do this, the environment variable ``SDL_WINDOWID`` 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. - - It is harmless to call this more than once, repeated calls have no effect. - - .. ## pygame.display.init ## - -.. function:: quit - - | :sl:`uninitialize the display module` - | :sg:`quit() -> None` - - 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. - - It is harmless to call this more than once, repeated calls have no effect. - - .. ## pygame.display.quit ## - -.. function:: get_init - - | :sl:`true if the display module is initialized` - | :sg:`get_init() -> bool` - - Returns True if the :mod:`pygame.display` module is currently initialized. - - .. ## pygame.display.get_init ## - -.. function:: set_mode - - | :sl:`initialize a window or screen for display` - | :sg:`set_mode(resolution=(0,0), flags=0, depth=0) -> Surface` - - 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. - - 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. - - The Surface that gets returned can be drawn to like a regular Surface but - changes will eventually be seen on the monitor. - - If no resolution is passed or is set to (0, 0) and pygame uses ``SDL`` - version 1.2.10 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 - ``SDL`` version prior to 1.2.10 will raise an exception. - - 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. - - 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. - - 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: - - :: - - pygame.FULLSCREEN create a fullscreen display - pygame.DOUBLEBUF recommended for HWSURFACE or OPENGL - pygame.HWSURFACE hardware accelerated, 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 - - .. ## pygame.display.set_mode ## - -.. function:: get_surface - - | :sl:`get a reference to the currently set display surface` - | :sg:`get_surface() -> Surface` - - Return a reference to the currently set display Surface. If no display mode - has been set this will return None. - - .. ## pygame.display.get_surface ## - -.. function:: flip - - | :sl:`update the full display Surface to the screen` - | :sg:`flip() -> None` - - This will update the contents of the entire display. If your display mode is - using the flags ``pygame.HWSURFACE`` and ``pygame.DOUBLEBUF``, 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. - - When using an ``pygame.OPENGL`` display mode this will perform a gl buffer - swap. - - .. ## pygame.display.flip ## - -.. function:: update - - | :sl:`update portions of the screen for software displays` - | :sg:`update(rectangle=None) -> None` - | :sg:`update(rectangle_list) -> None` - - This function is like an optimized version of ``pygame.display.flip()`` 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 ``pygame.display.flip()``. - - 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. - - This call cannot be used on ``pygame.OPENGL`` displays and will generate an - exception. - - .. ## pygame.display.update ## - -.. function:: get_driver - - | :sl:`get the name of the pygame display backend` - | :sg:`get_driver() -> name` - - 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 ``SDL_VIDEODRIVER`` flags in - ``pygame.display.set_mode()`` to see some of the common options. - - .. ## pygame.display.get_driver ## - -.. function:: Info - - | :sl:`Create a video display information object` - | :sg:`Info() -> VideoInfo` - - Creates a simple object containing several attributes to describe the - current graphics environment. If this is called before - ``pygame.display.set_mode()`` 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: - - :: - - 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. - - .. ## pygame.display.Info ## - -.. function:: get_wm_info - - | :sl:`Get information about the current windowing system` - | :sg:`get_wm_info() -> dict` - - 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. - - New with pygame 1.7.1 - - .. ## pygame.display.get_wm_info ## - -.. function:: list_modes - - | :sl:`get list of available fullscreen modes` - | :sg:`list_modes(depth=0, flags=pygame.FULLSCREEN) -> list` - - 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. A 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. - - If depth is 0, ``SDL`` will choose the current/best color depth for the - display. The flags defaults to ``pygame.FULLSCREEN``, but you may need to - add additional flags for specific fullscreen modes. - - .. ## pygame.display.list_modes ## - -.. function:: mode_ok - - | :sl:`pick the best color depth for a display mode` - | :sg:`mode_ok(size, flags=0, depth=0) -> depth` - - This function uses the same arguments as ``pygame.display.set_mode()``. 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. - - 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. - - The most useful flags to pass will be ``pygame.HWSURFACE``, - ``pygame.DOUBLEBUF``, and maybe ``pygame.FULLSCREEN``. The function will - return 0 if these display flags cannot be set. - - .. ## pygame.display.mode_ok ## - -.. function:: gl_get_attribute - - | :sl:`get the value for an opengl flag for the current display` - | :sg:`gl_get_attribute(flag) -> value` - - After calling ``pygame.display.set_mode()`` with the ``pygame.OPENGL`` flag, - it is a good idea to check the value of any requested OpenGL attributes. See - ``pygame.display.gl_set_attribute()`` for a list of valid flags. - - .. ## pygame.display.gl_get_attribute ## - -.. function:: gl_set_attribute - - | :sl:`request an opengl display attribute for the display mode` - | :sg:`gl_set_attribute(flag, value) -> None` - - When calling ``pygame.display.set_mode()`` with the ``pygame.OPENGL`` 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 ``pygame.display.set_mode()`` - - The ``OPENGL`` flags are; - - :: - - 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 - - .. ## pygame.display.gl_set_attribute ## - -.. function:: get_active - - | :sl:`true when the display is active on the display` - | :sg:`get_active() -> bool` - - After ``pygame.display.set_mode()`` 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. - - .. ## pygame.display.get_active ## - -.. function:: iconify - - | :sl:`iconify the display surface` - | :sg:`iconify() -> bool` - - 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. - - When the display is iconified ``pygame.display.get_active()`` will return - False. The event queue should receive a ``ACTIVEEVENT`` event when the - window has been iconified. - - .. ## pygame.display.iconify ## - -.. function:: toggle_fullscreen - - | :sl:`switch between fullscreen and windowed displays` - | :sg:`toggle_fullscreen() -> bool` - - 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 ``pygame.display.set_mode()`` with new display flags. - - .. ## pygame.display.toggle_fullscreen ## - -.. function:: set_gamma - - | :sl:`change the hardware gamma ramps` - | :sg:`set_gamma(red, green=None, blue=None) -> bool` - - 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. - - A gamma value of 1.0 creates a linear color table. Lower values will darken - the display and higher values will brighten. - - .. ## pygame.display.set_gamma ## - -.. function:: set_gamma_ramp - - | :sl:`change the hardware gamma ramps with a custom lookup` - | :sg:`set_gamma_ramp(red, green, blue) -> bool` - - 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. - - .. ## pygame.display.set_gamma_ramp ## - -.. function:: set_icon - - | :sl:`change the system image for the display window` - | :sg:`set_icon(Surface) -> None` - - 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. - - 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. - - Some systems do not allow the window icon to change after it has been shown. - This function can be called before ``pygame.display.set_mode()`` to create - the icon before the display mode is set. - - .. ## pygame.display.set_icon ## - -.. function:: set_caption - - | :sl:`set the current window caption` - | :sg:`set_caption(title, icontitle=None) -> None` - - 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. - - .. ## pygame.display.set_caption ## - -.. function:: get_caption - - | :sl:`get the current window caption` - | :sg:`get_caption() -> (title, icontitle)` - - Returns the title and icontitle for the display Surface. These will often be - the same value. - - .. ## pygame.display.get_caption ## - -.. function:: set_palette - - | :sl:`set the display color palette for indexed displays` - | :sg:`set_palette(palette=None) -> None` - - 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 - ``RGB`` triplets. - - .. ## pygame.display.set_palette ## - -.. ## pygame.display ##
--- a/docs/_sources/ref/draw.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.draw` -================== - -.. module:: pygame.draw - :synopsis: pygame module for drawing shapes - -| :sl:`pygame module for drawing shapes` - -Draw several simple shapes to a Surface. These functions will work for -rendering to any format of Surface. Rendering to hardware Surfaces will be -slower than regular software Surfaces. - -Most of the functions take a width argument to represent the size of stroke -around the edge of the shape. If a width of 0 is passed the function will -actually solid fill the entire shape. - -All the drawing functions respect the clip area for the Surface, and will be -constrained to that area. The functions return a rectangle representing the -bounding area of changed pixels. - -Most of the arguments accept a color argument that is an ``RGB`` triplet. These -can also accept an ``RGBA`` quadruplet. The alpha value will be written -directly into the Surface if it contains pixel alphas, but the draw function -will not draw transparently. The color argument can also be an integer pixel -value that is already mapped to the Surface's pixel format. - -These functions must temporarily lock the Surface they are operating on. Many -sequential drawing calls can be sped up by locking and unlocking the Surface -object around the draw calls. - -.. function:: rect - - | :sl:`draw a rectangle shape` - | :sg:`rect(Surface, color, Rect, width=0) -> Rect` - - Draws a rectangular shape on the Surface. The given Rect is the area of the - rectangle. The width argument is the thickness to draw the outer edge. If - width is zero then the rectangle will be filled. - - Keep in mind the ``Surface.fill()`` method works just as well for drawing - filled rectangles. In fact the ``Surface.fill()`` can be hardware - accelerated on some platforms with both software and hardware display modes. - - .. ## pygame.draw.rect ## - -.. function:: polygon - - | :sl:`draw a shape with any number of sides` - | :sg:`polygon(Surface, color, pointlist, width=0) -> Rect` - - Draws a polygonal shape on the Surface. The pointlist argument is the - vertices of the polygon. The width argument is the thickness to draw the - outer edge. If width is zero then the polygon will be filled. - - For aapolygon, use aalines with the 'closed' parameter. - - .. ## pygame.draw.polygon ## - -.. function:: circle - - | :sl:`draw a circle around a point` - | :sg:`circle(Surface, color, pos, radius, width=0) -> Rect` - - Draws a circular shape on the Surface. The pos argument is the center of the - circle, and radius is the size. The width argument is the thickness to draw - the outer edge. If width is zero then the circle will be filled. - - .. ## pygame.draw.circle ## - -.. function:: ellipse - - | :sl:`draw a round shape inside a rectangle` - | :sg:`ellipse(Surface, color, Rect, width=0) -> Rect` - - Draws an elliptical shape on the Surface. The given rectangle is the area - that the circle will fill. The width argument is the thickness to draw the - outer edge. If width is zero then the ellipse will be filled. - - .. ## pygame.draw.ellipse ## - -.. function:: arc - - | :sl:`draw a partial section of an ellipse` - | :sg:`arc(Surface, color, Rect, start_angle, stop_angle, width=1) -> Rect` - - Draws an elliptical arc on the Surface. The rect argument is the area that - the ellipse will fill. The two angle arguments are the initial and final - angle in radians, with the zero on the right. The width argument is the - thickness to draw the outer edge. - - .. ## pygame.draw.arc ## - -.. function:: line - - | :sl:`draw a straight line segment` - | :sg:`line(Surface, color, start_pos, end_pos, width=1) -> Rect` - - Draw a straight line segment on a Surface. There are no endcaps, the ends - are squared off for thick lines. - - .. ## pygame.draw.line ## - -.. function:: lines - - | :sl:`draw multiple contiguous line segments` - | :sg:`lines(Surface, color, closed, pointlist, width=1) -> Rect` - - Draw a sequence of lines on a Surface. The pointlist argument is a series of - points that are connected by a line. If the closed argument is true an - additional line segment is drawn between the first and last points. - - This does not draw any endcaps or miter joints. Lines with sharp corners and - wide line widths can have improper looking corners. - - .. ## pygame.draw.lines ## - -.. function:: aaline - - | :sl:`draw fine antialiased lines` - | :sg:`aaline(Surface, color, startpos, endpos, blend=1) -> Rect` - - Draws an anti-aliased line on a surface. This will respect the clipping - rectangle. A bounding box of the affected area is returned returned as a - rectangle. If blend is true, the shades will be be blended with existing - pixel shades instead of overwriting them. This function accepts floating - point values for the end points. - - .. ## pygame.draw.aaline ## - -.. function:: aalines - - | :sl:`draw a connected sequence of antialiased lines` - | :sg:`aalines(Surface, color, closed, pointlist, blend=1) -> Rect` - - Draws a sequence on a surface. You must pass at least two points in the - sequence of points. The closed argument is a simple boolean and if true, a - line will be draw between the first and last points. The boolean blend - argument set to true will blend the shades with existing shades instead of - overwriting them. This function accepts floating point values for the end - points. - - .. ## pygame.draw.aalines ## - -.. ## pygame.draw ##
--- a/docs/_sources/ref/event.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,287 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.event` -=================== - -.. module:: pygame.event - :synopsis: pygame module for interacting with events and queues - -| :sl:`pygame module for interacting with events and queues` - -Pygame handles all it's event messaging through an event queue. The routines in -this module help you manage that event queue. The input queue is heavily -dependent on the pygame display module. If the display has not been initialized -and a video mode not set, the event queue will not really work. - -The queue is a regular queue of Event objects, there are a variety of ways to -access the events it contains. From simply checking for the existance of -events, to grabbing them directly off the stack. - -All events have a type identifier. This event type is in between the values of -``NOEVENT`` and ``NUMEVENTS``. All user defined events can have the value of -``USEREVENT`` or higher. It is recommended make sure your event id's follow -this system. - -To get the state of various input devices, you can forego the event queue and -access the input devices directly with their appropriate modules; mouse, key, -and joystick. If you use this method, remember that pygame requires some form -of communication with the system window manager and other parts of the -platform. To keep pygame in synch with the system, you will need to call -``pygame.event.pump()`` to keep everything current. You'll want to call this -function usually once per game loop. - -The event queue offers some simple filtering. This can help performance -slightly by blocking certain event types from the queue, use the -``pygame.event.set_allowed()`` and ``pygame.event.set_blocked()`` to work with -this filtering. All events default to allowed. - -The event subsystem should be called from the main thread. If you want to post -events into the queue from other threads, please use the fastevent package. - -Joysticks will not send any events until the device has been initialized. - -An Event object contains an event type and a readonly set of member data. The -Event object contains no method functions, just member data. Event objects are -retrieved from the pygame event queue. You can create your own new events with -the ``pygame.event.Event()`` function. - -Your program must take steps to keep the event queue from overflowing. If the -program is not clearing or getting all events off the queue at regular -intervals, it can overflow. When the queue overflows an exception is thrown. - -All Event objects contain an event type identifier in the ``Event.type`` -member. You may also get full access to the Event's member data through the -``Event.dict`` method. All other member lookups will be passed through to the -Event's dictionary values. - -While debugging and experimenting, you can print the Event objects for a quick -display of its type and members. Events that come from the system will have a -guaranteed set of member items based on the type. Here is a list of the Event -members that are defined with each type. - -:: - - QUIT none - ACTIVEEVENT gain, state - KEYDOWN unicode, key, mod - KEYUP key, mod - MOUSEMOTION pos, rel, buttons - MOUSEBUTTONUP pos, button - MOUSEBUTTONDOWN pos, button - JOYAXISMOTION joy, axis, value - JOYBALLMOTION joy, ball, rel - JOYHATMOTION joy, hat, value - JOYBUTTONUP joy, button - JOYBUTTONDOWN joy, button - VIDEORESIZE size, w, h - VIDEOEXPOSE none - USEREVENT code - -Events support equality comparison. Two events are equal if they are the same -type and have identical attribute values. Inequality checks also work. - -.. versionadded:: 1.9.2 - - On MacOSX, USEREVENT can have `code = pygame.USEREVENT_DROPFILE`. That - means the user is trying to open a file with your application. The filename - can be found at `event.filename` - -.. function:: pump - - | :sl:`internally process pygame event handlers` - | :sg:`pump() -> None` - - For each frame of your game, you will need to make some sort of call to the - event queue. This ensures your program can internally interact with the rest - of the operating system. If you are not using other event functions in your - game, you should call ``pygame.event.pump()`` to allow pygame to handle - internal actions. - - This function is not necessary if your program is consistently processing - events on the queue through the other :mod:`pygame.event` functions. - - There are important things that must be dealt with internally in the event - queue. The main window may need to be repainted or respond to the system. If - you fail to make a call to the event queue for too long, the system may - decide your program has locked up. - - .. ## pygame.event.pump ## - -.. function:: get - - | :sl:`get events from the queue` - | :sg:`get() -> Eventlist` - | :sg:`get(type) -> Eventlist` - | :sg:`get(typelist) -> Eventlist` - - This will get all the messages and remove them from the queue. If a type or - sequence of types is given only those messages will be removed from the - queue. - - If you are only taking specific events from the queue, be aware that the - queue could eventually fill up with the events you are not interested. - - .. ## pygame.event.get ## - -.. function:: poll - - | :sl:`get a single event from the queue` - | :sg:`poll() -> Event` - - Returns a single event from the queue. If the event queue is empty an event - of type ``pygame.NOEVENT`` will be returned immediately. The returned event - is removed from the queue. - - .. ## pygame.event.poll ## - -.. function:: wait - - | :sl:`wait for a single event from the queue` - | :sg:`wait() -> Event` - - Returns a single event from the queue. If the queue is empty this function - will wait until one is created. The event is removed from the queue once it - has been returned. While the program is waiting it will sleep in an idle - state. This is important for programs that want to share the system with - other applications. - - .. ## pygame.event.wait ## - -.. function:: peek - - | :sl:`test if event types are waiting on the queue` - | :sg:`peek(type) -> bool` - | :sg:`peek(typelist) -> bool` - - Returns true if there are any events of the given type waiting on the queue. - If a sequence of event types is passed, this will return True if any of - those events are on the queue. - - .. ## pygame.event.peek ## - -.. function:: clear - - | :sl:`remove all events from the queue` - | :sg:`clear() -> None` - | :sg:`clear(type) -> None` - | :sg:`clear(typelist) -> None` - - Remove all events or events of a specific type from the queue. This has the - same effect as ``pygame.event.get()`` except nothing is returned. This can - be slightly more effecient when clearing a full event queue. - - .. ## pygame.event.clear ## - -.. function:: event_name - - | :sl:`get the string name from and event id` - | :sg:`event_name(type) -> string` - - Pygame uses integer ids to represent the event types. If you want to report - these types to the user they should be converted to strings. This will - return a the simple name for an event type. The string is in the WordCap - style. - - .. ## pygame.event.event_name ## - -.. function:: set_blocked - - | :sl:`control which events are allowed on the queue` - | :sg:`set_blocked(type) -> None` - | :sg:`set_blocked(typelist) -> None` - | :sg:`set_blocked(None) -> None` - - The given event types are not allowed to appear on the event queue. By - default all events can be placed on the queue. It is safe to disable an - event type multiple times. - - If None is passed as the argument, this has the opposite effect and ``ALL`` - of the event types are allowed to be placed on the queue. - - .. ## pygame.event.set_blocked ## - -.. function:: set_allowed - - | :sl:`control which events are allowed on the queue` - | :sg:`set_allowed(type) -> None` - | :sg:`set_allowed(typelist) -> None` - | :sg:`set_allowed(None) -> None` - - The given event types are allowed to appear on the event queue. By default - all events can be placed on the queue. It is safe to enable an event type - multiple times. - - If None is passed as the argument, ``NONE`` of the event types are allowed - to be placed on the queue. - - .. ## pygame.event.set_allowed ## - -.. function:: get_blocked - - | :sl:`test if a type of event is blocked from the queue` - | :sg:`get_blocked(type) -> bool` - - Returns true if the given event type is blocked from the queue. - - .. ## pygame.event.get_blocked ## - -.. function:: set_grab - - | :sl:`control the sharing of input devices with other applications` - | :sg:`set_grab(bool) -> None` - - When your program runs in a windowed environment, it will share the mouse - and keyboard devices with other applications that have focus. If your - program sets the event grab to True, it will lock all input into your - program. - - It is best to not always grab the input, since it prevents the user from - doing other things on their system. - - .. ## pygame.event.set_grab ## - -.. function:: get_grab - - | :sl:`test if the program is sharing input devices` - | :sg:`get_grab() -> bool` - - Returns true when the input events are grabbed for this application. Use - ``pygame.event.set_grab()`` to control this state. - - .. ## pygame.event.get_grab ## - -.. function:: post - - | :sl:`place a new event on the queue` - | :sg:`post(Event) -> None` - - This places a new event at the end of the event queue. These Events will - later be retrieved from the other queue functions. - - This is usually used for placing ``pygame.USEREVENT`` events on the queue. - Although any type of event can be placed, if using the sytem event types - your program should be sure to create the standard attributes with - appropriate values. - - .. ## pygame.event.post ## - -.. function:: Event - - | :sl:`create a new event object` - | :sg:`Event(type, dict) -> Event` - | :sg:`Event(type, **attributes) -> Event` - - Creates a new event with the given type. The event is created with the given - attributes and values. The attributes can come from a dictionary argument - with string keys, or from keyword arguments. The event object exposes its - dictionary as attribute __dict__, and also as dict for backward - compatibility. - - Attributes type, __dict__, and dict are readonly. Other attributes are - mutable. There are no methods attached to an Event object. - - Mutable attributes are new to Pygame 1.9.2. - - .. ## pygame.event.Event ## - -.. ## pygame.event ##
--- a/docs/_sources/ref/examples.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,481 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.examples` -====================== - -.. module:: pygame.examples - :synopsis: module of example programs - -| :sl:`module of example programs` - -These examples should help get you started with pygame. Here is a brief rundown -of what you get. The source code for these examples is in the public domain. -Feel free to use for your own projects. - -There are several ways to run the examples. First they can be run as -stand-alone programs. Second they can be imported and their ``main()`` methods -called (see below). Finally, the easiest way is to use the python -m option: - -:: - - python -m pygame.examples.<example name> <example arguments> - -eg: - -:: - - python -m pygame.examples.scaletest someimage.png - -Resources such as images and sounds for the examples are found in the -pygame/examples/data subdirectory. - -You can find where the example files are installed by using the following -commands inside the python interpreter. - -:: - - >>> import pygame.examples.scaletest - >>> pygame.examples.scaletest.__file__ - '/usr/lib/python2.6/site-packages/pygame/examples/scaletest.py' - -On each OS and version of python the location will be slightly different. -For example on windows it might be in 'C:/Python26/Lib/site-packages/pygame/examples/' -On Mac OS X it might be in '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pygame/examples/' - - -You can also run the examples in the python interpreter by calling each modules main() function. - -:: - - >>> import pygame.examples.scaletest - >>> pygame.examples.scaletest.main() - - -We're always on the lookout for more examples and/or example requests. Code -like this is probably the best way to start getting involved with python -gaming. - -examples as a package is new to pygame 1.9.0. But most of the examples came with -pygame much earlier. - -.. function:: aliens.main - - | :sl:`play the full aliens example` - | :sg:`aliens.main() -> None` - - This started off as a port of the ``SDL`` demonstration, Aliens. Now it has - evolved into something sort of resembling fun. This demonstrates a lot of - different uses of sprites and optimized blitting. Also transparency, - colorkeys, fonts, sound, music, joystick, and more. (PS, my high score is - 117! goodluck) - - .. ## pygame.examples.aliens.main ## - -.. function:: oldalien.main - - | :sl:`play the original aliens example` - | :sg:`oldalien.main() -> None` - - This more closely resembles a port of the ``SDL`` Aliens demo. The code is a - lot simpler, so it makes a better starting point for people looking at code - for the first times. These blitting routines are not as optimized as they - should/could be, but the code is easier to follow, and it plays quick - enough. - - .. ## pygame.examples.oldalien.main ## - -.. function:: stars.main - - | :sl:`run a simple starfield example` - | :sg:`stars.main() -> None` - - A simple starfield example. You can change the center of perspective by - leftclicking the mouse on the screen. - - .. ## pygame.examples.stars.main ## - -.. function:: chimp.main - - | :sl:`hit the moving chimp` - | :sg:`chimp.main() -> None` - - This simple example is derived from the line-by-line tutorial that comes - with pygame. It is based on a 'popular' web banner. Note there are comments - here, but for the full explanation, follow along in the tutorial. - - .. ## pygame.examples.chimp.main ## - -.. function:: moveit.main - - | :sl:`display animated objects on the screen` - | :sg:`moveit.main() -> None` - - This is the full and final example from the Pygame Tutorial, "How Do I Make - It Move". It creates 10 objects and animates them on the screen. - - Note it's a bit scant on error checking, but it's easy to read. :] - Fortunately, this is python, and we needn't wrestle with a pile of error - codes. - - .. ## pygame.examples.moveit.main ## - -.. function:: fonty.main - - | :sl:`run a font rendering example` - | :sg:`fonty.main() -> None` - - Super quick, super simple application demonstrating the different ways to - render fonts with the font module - - .. ## pygame.examples.fonty.main ## - -.. function:: vgrade.main - - | :sl:`display a vertical gradient` - | :sg:`vgrade.main() -> None` - - Demonstrates creating a vertical gradient with pixelcopy and NumPy python. - The app will create a new gradient every half second and report the time - needed to create and display the image. If you're not prepared to start - working with the NumPy arrays, don't worry about the source for this one :] - - .. ## pygame.examples.vgrade.main ## - -.. function:: eventlist.main - - | :sl:`display pygame events` - | :sg:`eventlist.main() -> None` - - Eventlist is a sloppy style of pygame, but is a handy tool for learning - about pygame events and input. At the top of the screen are the state of - several device values, and a scrolling list of events are displayed on the - bottom. - - This is not quality 'ui' code at all, but you can see how to implement very - non-interactive status displays, or even a crude text output control. - - .. ## pygame.examples.eventlist.main ## - -.. function:: arraydemo.main - - | :sl:`show various surfarray effects` - | :sg:`arraydemo.main(arraytype=None) -> None` - - Another example filled with various surfarray effects. It requires the - surfarray and image modules to be installed. This little demo can also make - a good starting point for any of your own tests with surfarray - - If arraytype is provided then use that array package. Valid values are - 'numeric' or 'numpy'. Otherwise default to NumPy, or fall back on Numeric if - NumPy is not installed. As a program ``surfarray.py`` accepts an optional - --numeric or --numpy flag. (New pygame 1.9.0) - - .. ## pygame.examples.arraydemo.main ## - -.. function:: sound.main - - | :sl:`load and play a sound` - | :sg:`sound.main(file_path=None) -> None` - - Extremely basic testing of the mixer module. Load a sound and play it. All - from the command shell, no graphics. - - If provided, use the audio file 'file_path', otherwise use a default file. - - ``sound.py`` optional command line argument: an audio file - - .. ## pygame.examples.sound.main ## - -.. function:: sound_array_demos.main - - | :sl:`play various sndarray effects` - | :sg:`sound_array_demos.main(arraytype=None) -> None` - - If arraytype is provided then use that array package. Valid values are - 'numeric' or 'numpy'. Otherwise default to NumPy, or fall back on Numeric if - NumPy is not installed. - - Uses sndarray and NumPy ( or Numeric) to create offset faded copies of the - original sound. Currently it just uses hardcoded values for the number of - echos and the delay. Easy for you to recreate as needed. Run as a program - ``sound_array_demos.py`` takes an optional command line option, --numpy or - --numeric, specifying which array package to use. - - .. ## pygame.examples.sound_array_demos.main ## - -.. function:: liquid.main - - | :sl:`display an animated liquid effect` - | :sg:`liquid.main() -> None` - - This example was created in a quick comparison with the BlitzBasic gaming - language. Nonetheless, it demonstrates a quick 8-bit setup (with colormap). - - .. ## pygame.examples.liquid.main ## - -.. function:: glcube.main - - | :sl:`display an animated 3D cube using OpenGL` - | :sg:`glcube.main() -> None` - - Using PyOpenGL and pygame, this creates a spinning 3D multicolored cube. - - .. ## pygame.examples.glcube.main ## - -.. function:: scrap_clipboard.main - - | :sl:`access the clipboard` - | :sg:`scrap_clipboard.main() -> None` - - A simple demonstration example for the clipboard support. - - .. ## pygame.examples.scrap_clipboard.main ## - -.. function:: mask.main - - | :sl:`display multiple images bounce off each other using collision detection` - | :sg:`mask.main(*args) -> None` - - Positional arguments: - - :: - - one or more image file names. - - This ``pygame.masks`` demo will display multiple moving sprites bouncing off - each other. More than one sprite image can be provided. - - If run as a program then ``mask.py`` takes one or more image files as - command line arguments. - - .. ## pygame.examples.mask.main ## - -.. function:: testsprite.main - - | :sl:`show lots of sprites moving around` - | :sg:`testsprite.main(update_rects = True, use_static = False, use_FastRenderGroup = False, screen_dims = [640, 480], use_alpha = False, flags = 0) -> None` - - Optional keyword arguments: - - :: - - update_rects - use the RenderUpdate sprite group class - use_static - include non-moving images - use_FastRenderGroup - Use the FastRenderGroup sprite group - screen_dims - pygame window dimensions - use_alpha - use alpha blending - flags - additional display mode flags - - Like the ``testsprite.c`` that comes with sdl, this pygame version shows - lots of sprites moving around. - - If run as a stand-alone program then no command line arguments are taken. - - .. ## pygame.examples.testsprite.main ## - -.. function:: headless_no_windows_needed.main - - | :sl:`write an image file that is smoothscaled copy of an input file` - | :sg:`headless_no_windows_needed.main(fin, fout, w, h) -> None` - - arguments: - - :: - - fin - name of an input image file - fout - name of the output file to create/overwrite - w, h - size of the rescaled image, as integer width and height - - How to use pygame with no windowing system, like on headless servers. - - Thumbnail generation with scaling is an example of what you can do with - pygame. - - ``NOTE``: the pygame scale function uses mmx/sse if available, and can be - run in multiple threads. - - If ``headless_no_windows_needed.py`` is run as a program it takes the - following command line arguments: - - :: - - -scale inputimage outputimage new_width new_height - eg. -scale in.png outpng 50 50 - - .. ## pygame.examples.headless_no_windows_needed.main ## - -.. function:: fastevents.main - - | :sl:`stress test the fastevents module` - | :sg:`fastevents.main() -> None` - - This is a stress test for the fastevents module. - - * Fast events does not appear faster! - - * - - So far it looks like normal :mod:`pygame.event` is faster by up to two - times. So maybe fastevent isn't fast at all. - - Tested on windowsXP sp2 athlon, and freebsd. - - However... on my debian duron 850 machine fastevents is faster. - - .. ## pygame.examples.fastevents.main ## - -.. function:: overlay.main - - | :sl:`play a .pgm video using overlays` - | :sg:`overlay.main(fname) -> None` - - Play the .pgm video fila a path fname. - - If run as a program ``overlay.py`` takes the file name as a command line - argument. - - .. ## pygame.examples.overlay.main ## - -.. function:: blend_fill.main - - | :sl:`demonstrate the various surface.fill method blend options` - | :sg:`blend_fill.main() -> None` - - A interactive demo that lets one choose which BLEND_xxx option to apply to a - surface. - - .. ## pygame.examples.blend_fill.main ## - -.. function:: blit_blends.main - - | :sl:`uses alternative additive fill to that of surface.fill` - | :sg:`blit_blends.main() -> None` - - Fake additive blending. Using NumPy. it doesn't clamp. Press r,g,b Somewhat - like blend_fill. - - .. ## pygame.examples.blit_blends.main ## - -.. function:: cursors.main - - | :sl:`display two different custom cursors` - | :sg:`cursors.main() -> None` - - Display an arrow or circle with crossbar cursor. - - .. ## pygame.examples.cursors.main ## - -.. function:: pixelarray.main - - | :sl:`display various pixelarray generated effects` - | :sg:`pixelarray.main() -> None` - - Display various pixelarray generated effects. - - .. ## pygame.examples.pixelarray.main ## - -.. function:: scaletest.main - - | :sl:`interactively scale an image using smoothscale` - | :sg:`scaletest.main(imagefile, convert_alpha=False, run_speed_test=True) -> None` - - arguments: - - :: - - imagefile - file name of source image (required) - convert_alpha - use convert_alpha() on the surf (default False) - run_speed_test - (default False) - - A smoothscale example that resized an image on the screen. Vertical and - horizontal arrow keys are used to change the width and height of the - displayed image. If the convert_alpha option is True then the source image - is forced to have source alpha, whether or not the original images does. If - run_speed_test is True then a background timing test is performed instead of - the interactive scaler. - - If ``scaletest.py`` is run as a program then the command line options are: - - :: - - ImageFile [-t] [-convert_alpha] - [-t] = Run Speed Test - [-convert_alpha] = Use convert_alpha() on the surf. - - .. ## pygame.examples.scaletest.main ## - -.. function:: midi.main - - | :sl:`run a midi example` - | :sg:`midi.main(mode='output', device_id=None) -> None` - - Arguments: - - :: - - mode - if 'output' run a midi keyboard output example - 'input' run a midi event logger input example - 'list' list available midi devices - (default 'output') - device_id - midi device number; if None then use the default midi input or - output device for the system - - The output example shows how to translate mouse clicks or computer keyboard - events into midi notes. It implements a rudimentary button widget and state - machine. - - The input example shows how to translate midi input to pygame events. - - With the use of a virtual midi patch cord the output and input examples can - be run as separate processes and connected so the keyboard output is - displayed on a console. - - new to pygame 1.9.0 - - .. ## pygame.examples.midi.main ## - -.. function:: scroll.main - - | :sl:`run a Surface.scroll example that shows a magnified image` - | :sg:`scroll.main(image_file=None) -> None` - - This example shows a scrollable image that has a zoom factor of eight. It - uses the :func:`Surface.scroll` function to shift the image on the display - surface. A clip rectangle protects a margin area. If called as a function, - the example accepts an optional image file path. If run as a program it - takes an optional file path command line argument. If no file is provided a - default image file is used. - - When running click on a black triangle to move one pixel in the direction - the triangle points. Or use the arrow keys. Close the window or press - ``ESC`` to quit. - - .. ## pygame.examples.scroll.main ## - -.. function:: movieplayer.main - - | :sl:`play an MPEG movie` - | :sg:`movieplayer.main(filepath) -> None` - - A simple movie player that plays an ``MPEG`` movie in a Pygame window. It - showcases the :mod:`pygame.movie` module. The window adjusts to the size of - the movie image. It is given a border to demonstrate that a movie can play - autonomously in a sub- window. Also, the file is copied to a file like - object to show that not just Python files can be used as a movie source. - - The :mod:`pygame.movie` module is problematic and may not work on all - systems. It is intended to replace it with an ffmpeg based version. - - .. ## pygame.examples.movieplayer.main ## - -.. function:: camera.main - - | :sl:`display video captured live from an attached camera` - | :sg:`camera.main() -> None` - - A simple live video player, it uses the first available camera it finds on - the system. - - .. ## pygame.examples.camera.main ## - -.. ## pygame.examples ##
--- a/docs/_sources/ref/font.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,324 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.font` -================== - -.. module:: pygame.font - :synopsis: pygame module for loading and rendering fonts - -| :sl:`pygame module for loading and rendering fonts` - -The font module allows for rendering TrueType fonts into a new Surface object. -It accepts any UCS-2 character ('\u0001' to '\uFFFF'). This module is optional -and requires SDL_ttf as a dependency. You should test that :mod:`pygame.font` -is available and initialized before attempting to use the module. - -Most of the work done with fonts are done by using the actual Font objects. The -module by itself only has routines to initialize the module and create Font -objects with ``pygame.font.Font()``. - -You can load fonts from the system by using the ``pygame.font.SysFont()`` -function. There are a few other functions to help lookup the system fonts. - -Pygame comes with a builtin default font. This can always be accessed by -passing None as the font name. - -To use the :mod:`pygame.freetype` based :mod:`pygame.ftfont` as -:mod:`pygame.font` define the enviroment variable PYGAME_FREETYPE before the -first import of :mod:`pygame`. :mod:`pygame.ftfont` is a :mod:`pygame.font` -compatible module that passes all but one of the font module unit tests: -it does not have the UCS-2 limitation of the SDL_ttf based font module, so -fails to raise an exception for a code point greater than '\uFFFF'. If -:mod:`pygame.freetype` is unavailable then the SDL_ttf font module will be -loaded instead. - -.. function:: init - - | :sl:`initialize the font module` - | :sg:`init() -> None` - - This method is called automatically by ``pygame.init()``. It initializes the - font module. The module must be initialized before any other functions will - work. - - It is safe to call this function more than once. - - .. ## pygame.font.init ## - -.. function:: quit - - | :sl:`uninitialize the font module` - | :sg:`quit() -> None` - - Manually uninitialize SDL_ttf's font system. This is called automatically by - ``pygame.quit()``. - - It is safe to call this function even if font is currently not initialized. - - .. ## pygame.font.quit ## - -.. function:: get_init - - | :sl:`true if the font module is initialized` - | :sg:`get_init() -> bool` - - Test if the font module is initialized or not. - - .. ## pygame.font.get_init ## - -.. function:: get_default_font - - | :sl:`get the filename of the default font` - | :sg:`get_default_font() -> string` - - Return the filename of the system font. This is not the full path to the - file. This file can usually be found in the same directory as the font - module, but it can also be bundled in separate archives. - - .. ## pygame.font.get_default_font ## - -.. function:: get_fonts - - | :sl:`get all available fonts` - | :sg:`get_fonts() -> list of strings` - - Returns a list of all the fonts available on the system. The names of the - fonts will be set to lowercase with all spaces and punctuation removed. This - works on most systems, but some will return an empty list if they cannot - find fonts. - - .. ## pygame.font.get_fonts ## - -.. function:: match_font - - | :sl:`find a specific font on the system` - | :sg:`match_font(name, bold=False, italic=False) -> path` - - Returns the full path to a font file on the system. If bold or italic are - set to true, this will attempt to find the correct family of font. - - The font name can actually be a comma separated list of font names to try. - If none of the given names are found, None is returned. - - Example: - - :: - - print pygame.font.match_font('bitstreamverasans') - # output is: /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf - # (but only if you have Vera on your system) - - .. ## pygame.font.match_font ## - -.. function:: SysFont - - | :sl:`create a Font object from the system fonts` - | :sg:`SysFont(name, size, bold=False, italic=False) -> Font` - - Return a new Font object that is loaded from the system fonts. The font will - match the requested bold and italic flags. If a suitable system font is not - found this will fallback on loading the default pygame font. The font name - can be a comma separated list of font names to look for. - - .. ## pygame.font.SysFont ## - -.. class:: Font - - | :sl:`create a new Font object from a file` - | :sg:`Font(filename, size) -> Font` - | :sg:`Font(object, size) -> Font` - - Load a new font from a given filename or a python file object. The size is - the height of the font in pixels. If the filename is None the Pygame default - font will be loaded. If a font cannot be loaded from the arguments given an - exception will be raised. Once the font is created the size cannot be - changed. - - Font objects are mainly used to render text into new Surface objects. The - render can emulate bold or italic features, but it is better to load from a - font with actual italic or bold glyphs. The rendered text can be regular - strings or unicode. - - .. method:: render - - | :sl:`draw text on a new Surface` - | :sg:`render(text, antialias, color, background=None) -> Surface` - - This creates a new Surface with the specified text rendered on it. Pygame - provides no way to directly draw text on an existing Surface: instead you - must use ``Font.render()`` to create an image (Surface) of the text, then - blit this image onto another Surface. - - The text can only be a single line: newline characters are not rendered. - Null characters ('\x00') raise a TypeError. Both Unicode and char (byte) - strings are accepted. For Unicode strings only UCS-2 characters ('\u0001' - to '\uFFFF') are recognized. Anything greater raises a UnicodeError. For - char strings a ``LATIN1`` encoding is assumed. The antialias argument is - a boolean: if true the characters will have smooth edges. The color - argument is the color of the text [e.g.: (0,0,255) for blue]. The - optional background argument is a color to use for the text background. - If no background is passed the area outside the text will be transparent. - - The Surface returned will be of the dimensions required to hold the text. - (the same as those returned by Font.size()). If an empty string is passed - for the text, a blank surface will be returned that is one pixel wide and - the height of the font. - - Depending on the type of background and antialiasing used, this returns - different types of Surfaces. For performance reasons, it is good to know - what type of image will be used. If antialiasing is not used, the return - image will always be an 8bit image with a two color palette. If the - background is transparent a colorkey will be set. Antialiased images are - rendered to 24-bit ``RGB`` images. If the background is transparent a - pixel alpha will be included. - - Optimization: if you know that the final destination for the text (on the - screen) will always have a solid background, and the text is antialiased, - you can improve performance by specifying the background color. This will - cause the resulting image to maintain transparency information by - colorkey rather than (much less efficient) alpha values. - - If you render '\n' a unknown char will be rendered. Usually a rectangle. - Instead you need to handle new lines yourself. - - Font rendering is not thread safe: only a single thread can render text - at any time. - - .. ## Font.render ## - - .. method:: size - - | :sl:`determine the amount of space needed to render text` - | :sg:`size(text) -> (width, height)` - - Returns the dimensions needed to render the text. This can be used to - help determine the positioning needed for text before it is rendered. It - can also be used for wordwrapping and other layout effects. - - Be aware that most fonts use kerning which adjusts the widths for - specific letter pairs. For example, the width for "ae" will not always - match the width for "a" + "e". - - .. ## Font.size ## - - .. method:: set_underline - - | :sl:`control if text is rendered with an underline` - | :sg:`set_underline(bool) -> None` - - When enabled, all rendered fonts will include an underline. The underline - is always one pixel thick, regardless of font size. This can be mixed - with the bold and italic modes. - - .. ## Font.set_underline ## - - .. method:: get_underline - - | :sl:`check if text will be rendered with an underline` - | :sg:`get_underline() -> bool` - - Return True when the font underline is enabled. - - .. ## Font.get_underline ## - - .. method:: set_bold - - | :sl:`enable fake rendering of bold text` - | :sg:`set_bold(bool) -> None` - - Enables the bold rendering of text. This is a fake stretching of the font - that doesn't look good on many font types. If possible load the font from - a real bold font file. While bold, the font will have a different width - than when normal. This can be mixed with the italic and underline modes. - - .. ## Font.set_bold ## - - .. method:: get_bold - - | :sl:`check if text will be rendered bold` - | :sg:`get_bold() -> bool` - - Return True when the font bold rendering mode is enabled. - - .. ## Font.get_bold ## - - .. method:: set_italic - - | :sl:`enable fake rendering of italic text` - | :sg:`set_italic(bool) -> None` - - Enables fake rendering of italic text. This is a fake skewing of the font - that doesn't look good on many font types. If possible load the font from - a real italic font file. While italic the font will have a different - width than when normal. This can be mixed with the bold and underline - modes. - - .. ## Font.set_italic ## - - .. method:: metrics - - | :sl:`Gets the metrics for each character in the pased string.` - | :sg:`metrics(text) -> list` - - The list contains tuples for each character, which contain the minimum - ``X`` offset, the maximum ``X`` offset, the minimum ``Y`` offset, the - maximum ``Y`` offset and the advance offset (bearing plus width) of the - character. [(minx, maxx, miny, maxy, advance), (minx, maxx, miny, maxy, - advance), ...]. None is entered in the list for each unrecognized - character. - - .. ## Font.metrics ## - - .. method:: get_italic - - | :sl:`check if the text will be rendered italic` - | :sg:`get_italic() -> bool` - - Return True when the font italic rendering mode is enabled. - - .. ## Font.get_italic ## - - .. method:: get_linesize - - | :sl:`get the line space of the font text` - | :sg:`get_linesize() -> int` - - Return the height in pixels for a line of text with the font. When - rendering multiple lines of text this is the recommended amount of space - between lines. - - .. ## Font.get_linesize ## - - .. method:: get_height - - | :sl:`get the height of the font` - | :sg:`get_height() -> int` - - Return the height in pixels of the actual rendered text. This is the - average size for each glyph in the font. - - .. ## Font.get_height ## - - .. method:: get_ascent - - | :sl:`get the ascent of the font` - | :sg:`get_ascent() -> int` - - Return the height in pixels for the font ascent. The ascent is the number - of pixels from the font baseline to the top of the font. - - .. ## Font.get_ascent ## - - .. method:: get_descent - - | :sl:`get the descent of the font` - | :sg:`get_descent() -> int` - - Return the height in pixels for the font descent. The descent is the - number of pixels from the font baseline to the bottom of the font. - - .. ## Font.get_descent ## - - .. ## pygame.font.Font ## - -.. ## pygame.font ##
--- a/docs/_sources/ref/freetype.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,533 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.freetype` -====================== - -.. module:: pygame.freetype - :synopsis: Enhanced Pygame module for loading and rendering computer fonts - -| :sl:`Enhanced Pygame module for loading and rendering computer fonts` - ---- Note that some features may change before a formal release - -The :mod:`pygame.freetype` module allows for the rendering of all font file formats -supported by FreeType, namely ``TTF``, Type1, ``CFF``, OpenType, ``SFNT``, ``PCF``, -``FNT``, ``BDF``, ``PFR`` and Type42 fonts. It can render any UTF-32 character in a -font file. - -This module is a replacement for :mod:`pygame.font`. It has all of the functionality -of the original, plus many new features. Yet is has absolutely no dependencies -on the SDL_ttf library. The :mod:`pygame.freetype` module is not itself backward -compatible with :mod:`pygame.font`. Instead, a new :mod:`pygame.ftfont` provides -a drop-in replacement for :mod:`pygame.font`. - -Most of the work done with fonts is done by using the actual Font objects. The -module by itself only has routines to initialize itself and create Font objects -with ``pygame.freetype.Font()``. - -You can load fonts from the system by using the ``pygame.freetype.SysFont()`` -function. There are a few other functions to help find system fonts. - -For now undefined character codes are replaced with the ``undefined character``. -How undefined codes are handled may become configurable in a future release. - -Pygame comes with a builtin default font. This can always be accessed by -passing None as the font name to the Font constructor. - -New in Pygame 1.9.2 - -.. function:: get_error - - | :sl:`Return the latest FreeType2 error` - | :sg:`get_error() -> str` - - Return a description of the last error which occurred in the FreeType2 - library, or None if no errors have occurred. - -.. function:: get_version - - | :sl:`Return the FreeType 2 version` - | :sg:`get_version() -> (int, int, int)` - - Returns the version of the FreeType2 library which was used to build the - 'freetype' module. - - Note that the freetype module depends on the FreeType 2 library. It will - not compile with the original FreeType 1.0. Hence, the first element of the - tuple will always be "2". - -.. function:: init - - | :sl:`Initialize the underlying FreeType 2 library.` - | :sg:`init(cache_size=64, resolution=72) -> None` - - This function initializes the underlying FreeType 2 library and must be - called before trying to use any of the functionality of the 'freetype' - module. - - However, this function will be automatically called by ``pygame.init()``. - It is safe to call this function more than once. - - Optionally, you may specify a default size for the Glyph cache: this is the - maximum number of glyphs that will be cached at any given time by the - module. Exceedingly small values will be automatically tuned for - performance. Also a default pixel resolution, in dots per inch, can - be given to adjust font scaling. - -.. function:: quit - - | :sl:`Shut down the underlying FreeType 2 library.` - | :sg:`quit() -> None` - - This function de-initializes the ``freetype`` module. After calling this - function, you should not invoke any class, method or function related to the - ``freetype`` module as they are likely to fail or might give unpredictable - results. It is safe to call this function even if the module hasn't been - initialized yet. - -.. function:: was_init - - | :sl:`Return whether the the FreeType 2 library is initialized.` - | :sg:`was_init() -> bool` - - Returns whether the the FreeType 2 library is initialized. - -.. function:: get_default_resolution - - | :sl:`Return the default pixel size in dots per inch` - | :sg:`get_default_resolution() -> long` - - Returns the default pixel size, in dots per inch for the module. If not changed - it will be 72. - -.. function:: set_default_resolution - - | :sl:`Set the default pixel size in dots per inch for the module` - | :sg:`set_default_resolution([resolution]) -> None` - - Set the default pixel size, in dots per inch, for the module. If the - optional argument is omitted or zero the resolution is reset to 72. - -.. function:: get_default_font - - | :sl:`Get the filename of the default font` - | :sg:`get_default_font() -> string` - - Return the filename of the system font. This is not the full path to the - file. This file can usually be found in the same directory as the font - module, but it can also be bundled in separate archives. - -.. class:: Font - - | :sl:`Create a new Font instance from a supported font file.` - | :sg:`Font(file, style=STYLE_NONE, ptsize=-1, font_index=0, vertical=0, ucs4=0, resolution=0) -> Font` - - Argument *file* can be either a string representing the font's filename, a - file-like object containing the font, or None; if None, the default, built-in font - is used. - - Optionally, a *ptsize* argument may be specified to set the default size in - points, which will be used when rendering the font. The size can also be - passed explicitly to each method call. Because of the way the caching - system works, specifying a default size on the constructor doesn't imply a - performance gain over manually passing the size on each function call. - - If the font file has more than one font, the font to load can be chosen with - the *index* argument. An exception is raised for an out-of-range font index - value. - - The *style* argument will set the default style (oblique, underline, strong) - used to draw this font. This style may be overridden on any :meth:`Font.render` - call. - - The optional vertical argument, an integer, sets the default orientation - for the font: 0 (False) for horizontal, any other value (True) for vertical. - See :attr:`Font.vertical`. - - The optional ucs4 argument, an integer, sets the default text translation - mode: 0 (False) recognize UTF-16 surrogate pairs, any other value (True), - to treat Unicode text as UCS-4, with no surrogate pairs. See - :attr:`Font.ucs4`. - - The optional resolution argument sets the pixel size, in dots per inch, - for use in scaling glyphs for this Font instance. If 0 then the default - module value, set by :meth:`freetype.init`, is used. The Font object's - resolution can only be changed by reinitializing the Font instance. - - .. attribute:: name - - | :sl:`Proper font name.` - | :sg:`name -> string` - - Read only. Returns the real (long) name of the font, as - recorded in the font file. - - .. attribute:: path - - | :sl:`Font file path` - | :sg:`path -> unicode` - - Read only. Returns the path of the loaded font file - - .. method:: get_rect - - | :sl:`Return the size and offset of rendered text` - | :sg:`get_rect(text, style=STYLE_DEFAULT, rotation=0, ptsize=default) -> rect` - - Gets the final dimensions and origin, in pixels, of 'text' using the - current point size, style, rotation and orientation. These are either - taken from the arguments, if given, else from the default values set - for the font object. - - Returns a rect containing the width and height of the text's bounding - box and the position of the text's origin. The origin can be used - to align separately rendered pieces of text. It gives the baseline - position and bearing at the start of the text. - - If text is a char (byte) string, then its encoding is assumed to be - ``LATIN1``. - - .. method:: get_metrics - - | :sl:`Return the glyph metrics for the given text` - | :sg:`get_metrics(text, ptsize=default) -> [(...), ...]` - - Returns the glyph metrics for each character in 'text'. - - The glyph metrics are returned inside a list; each character will be - represented as a tuple inside the list with the following values: - - :: - - (min_x, max_x, min_y, max_y, horizontal_advance_x, horizontal_advance_y) - - The bounding box min_x, max_y, min_y, and max_y values are returned as - grid-fitted pixel coordinates of type int. The advance values are - float values. - - The calculations are done using the font's default size in points. - Optionally you may specify another point size to use. - - The metrics are adjusted for the current rotation, strong, and oblique - settings. - - If text is a char (byte) string, then its encoding is assumed to be - ``LATIN1``. - - .. attribute:: height - - | :sl:`The unscaled height of the font in font units` - | :sg:`height -> int` - - Read only. Gets the height of the font. This is the average value of all - glyphs in the font. - - .. method:: ascender - - | :sl:`The unscaled ascent of the font in font units` - | :sg:`ascender -> int` - - Read only. Return the number of units from the font's baseline to - the top of the bounding box. - - .. attribute:: descender - - | :sl:`The unscaled descent of the font in font units` - | :sg:`descender -> int` - - Read only. Return the height in font units for the font descent. - The descent is the number of units from the font's baseline to the - bottom of the bounding box. - - .. attribute:: get_sized_ascender - - | :sl:`The scaled ascent of the font in pixels` - | :sg:`get_sized_ascender() -> int` - - Return the number of units from the font's baseline to the top of the - bounding box. It is not adjusted for strong or rotation. - - .. method:: get_sized_descender - - | :sl:`The scaled descent of the font in pixels` - | :sg:`get_sized_descender() -> int` - - Return the number of pixels from the font's baseline to the top of the - bounding box. It is not adjusted for strong or rotation. - - .. attribute:: get_sized_height - - | :sl:`The scaled height of the font in pixels` - | :sg:`get_sized_height() -> int` - - Read only. Gets the height of the font. This is the average value of all - glyphs in the font. It is not adjusted for strong or rotation. - - .. method:: get_sized_glyph_height - - | :sl:`The scaled bounding box height of the font in pixels` - | :sg:`get_sized_glyph_height() -> int` - - Return the glyph bounding box height of the font in pixels. - This is the average value of all glyphs in the font. - It is not adjusted for strong or rotation. - - .. method:: render - - | :sl:`Return rendered text as a surface` - | :sg:`render(text, fgcolor, bgcolor=None, style=STYLE_DEFAULT, rotation=0, ptsize=default) -> (Surface, Rect)` - - Returns a new :mod:`pygame.Surface`, with the text rendered to it - in the color given by 'fgcolor'. If ``bgcolor`` is given, the surface - will be filled with this color. If no background color is given, - the surface is filled with zero alpha opacity. Normally the returned - surface has a 32 bit pixel size. However, if ``bgcolor`` is ``None`` - and anti-aliasing is disabled a two color 8 bit surface with colorkey - set for the background color is returned. - - The return value is a tuple: the new surface and the bounding - rectangle giving the size and origin of the rendered text. - - If an empty string is passed for text then the returned Rect is zero - width and the height of the font. If dest is None the returned surface is - the same dimensions as the boundary rect. The rect will test False. - - The rendering is done using the font's default size in points and its - default style, without any rotation, and taking into account fonts which - are set to be drawn vertically via the :meth:`Font.vertical` attribute. - Optionally you may specify another point size to use via the 'ptsize' - argument, a text rotation via the 'rotation' argument, or a new text - style via the 'style' argument. - - If text is a char (byte) string, then its encoding is assumed to be - ``LATIN1``. - - .. method:: render_to - - | :sl:`Render text onto an existing surface` - | :sg:`render(surf, dest, text, fgcolor, bgcolor=None, style=STYLE_DEFAULT, rotation=0, ptsize=default) -> Rect` - - Renders the string 'text' to a :mod:`pygame.Surface` 'surf', - using the color 'fgcolor'. - - Argument 'dest' is an (x, y) surface coordinate pair. If either x - or y is not an integer it is converted to one if possible. - Any sequence, including Rect, for which the first two elements are - positions x and y is accepted. - - If a background color is given, the surface is first filled with that - color. The text is blitted next. Both the background fill and text - rendering involve full alpha blits. That is, the alpha values of - both the foreground and background colors, as well as those of the - destination surface if it has per-pixel alpha. - - The return value is a rectangle giving the size and position of the - rendered text within the surface. - - If an empty string is passed for text then the returned Rect is zero - width and the height of the font. The rect will test False. - - By default, the point size and style set for the font are used - if not passed as arguments. The text is unrotated unless a non-zero - rotation value is given. - - If text is a char (byte) string, then its encoding is assumed to be - ``LATIN1``. - - .. method:: render_raw - - | :sl:`Return rendered text as a string of bytes` - | :sg:`render_raw(text, style=STYLE_DEFAULT, rotation=0, ptsize=default, invert=False) -> (bytes, (int, int))` - - Like ``Font.render()`` but the tuple returned is an 8 bit - monochrome string of bytes and its size. The foreground color is 255, the - background 0, useful as an alpha mask for a foreground pattern. - - .. method:: render_raw_to - - | :sl:`Render text into an array of ints` - | :sg:`render_raw_to(array, text, dest=None, style=STYLE_DEFAULT, rotation=0, ptsize=default, invert=False) -> (int, int)` - - Render to an array object exposing an array struct interface. The array - must be two dimensional with integer items. The default dest value, None, - is equivalent to (0, 0). - - .. attribute:: style - - | :sl:`The font's style flags` - | :sg:`style <-> int` - - Gets or sets the default style of the Font. This default style will be - used for all text rendering and size calculations unless overridden - specifically in the \`render()` or \`get_size()` calls. The style value - may be a bit-wise ``OR`` of one or more of the following constants: - - :: - - STYLE_NONE - STYLE_UNDERLINE - STYLE_OBLIQUE - STYLE_STRONG - STYLE_WIDE - - These constants may be found on the FreeType constants module. - Optionally, the default style can be modified or obtained accessing the - individual style attributes (underline, oblique, strong). - - .. attribute:: underline - - | :sl:`The state of the font's underline style flag` - | :sg:`underline <-> bool` - - Gets or sets whether the font will be underlined when drawing text. This - default style value will be used for all text rendering and size - calculations unless overridden specifically in the \`render()` or - \`get_size()` calls, via the 'style' parameter. - - .. attribute:: strong - - | :sl:`The state of the font's strong style flag` - | :sg:`strong <-> bool` - - Gets or sets whether the font will be bold when drawing text. This - default style value will be used for all text rendering and size - calculations unless overridden specifically in the \`render()` or - \`get_size()` calls, via the 'style' parameter. - - .. attribute:: oblique - - | :sl:`The state of the font's oblique style flag` - | :sg:`oblique <-> bool` - - Gets or sets whether the font will be rendered as oblique. This - default style value will be used for all text rendering and size - calculations unless overridden specifically in the \`render()` or - \`get_size()` calls, via the 'style' parameter. - - .. attribute:: wide - - | :sl:`The state of the font's wide style flag` - | :sg:`wide <-> bool` - - Gets or sets whether the font will be stretched horizontally - when drawing text. It produces a result similar to font.Font's - bold. This style is only available for unrotated text. - - .. attribute:: strength - - | :sl:`The strength associated with the strong or wide font styles` - | :sg:`strength <-> float` - - The amount by which a font glyph's size is enlarged for the - strong or wide transformations, as a fraction of the untransformed - size. For the wide style only the horizontal dimension is - increased. For strong text both the horizontal and vertical - dimensions are enlarged. A wide style of strength 1/12 is - equivalent to the font.Font bold style. The default is 1/36. - - .. attribute:: underline_adjustment - - | :sl:`Adjustment factor for the underline position` - | :sg:`underline_adjustment <-> float` - - Gets or sets a factor which, when positive, is multiplied with the - font's underline offset to adjust the underline position. A negative - value turns an underline into a strike-through or overline. It is - multiplied with the ascender. Accepted values are between -2.0 and 2.0 - inclusive. A value of 0.5 closely matches Tango underlining. A value of - 1.0 mimics SDL_ttf. - - .. attribute:: fixed_width - - | :sl:`Gets whether the font is fixed-width` - | :sg:`fixed_width -> bool` - - Read only. Returns whether this Font is a fixed-width (bitmap) font. - - Note that scalable fonts whose glyphs are all the same width (i.e. - monospace ``TTF`` fonts used for programming) are not considered fixed - width. - - .. attribute:: antialiased - - | :sl:`Font anti-aliasing mode` - | :sg:`antialiased <-> bool` - - Gets or sets the font's anti-aliasing mode. This defaults to ``True`` on - all fonts, which are rendered with full 8 bit blending. - - Setting this to ``False`` will enable monochrome rendering. This should - provide a small speed gain and reduce cache memory size. - - .. attribute:: kerning - - | :sl:`Character kerning mode` - | :sg:`kerning -> bool` - - Gets or sets the font's kerning mode. This defaults to False on all - fonts, which will be rendered by default without kerning. - - Setting this to true will change all rendering methods to do kerning - between character pairs for surface size calculation and all - render operations. - - .. attribute:: vertical - - | :sl:`Font vertical mode` - | :sg:`vertical -> bool` - - Gets or sets whether the font is a vertical font such as fonts in fonts - representing Kanji glyphs or other styles of vertical writing. - - Changing this attribute will cause the font to be rendering vertically, - and affects all other methods which manage glyphs or text layouts to use - vertical metrics accordingly. - - Note that the FreeType library doesn't automatically detect whether a - font contains glyphs which are always supposed to be drawn vertically, so - this attribute must be set manually by the user. - - Also note that several font formats (especially bitmap based ones) don't - contain the necessary metrics to draw glyphs vertically, so drawing in - those cases will give unspecified results. - - .. attribute:: origin - - | :sl:`Font render to text origin mode` - | :sg:`vertical -> bool` - - If set True, then when rendering to an existing surface, the position - is taken to be that of the text origin. Otherwise the render position is - the top-left corner of the text bounding box. - - .. attribute:: pad - - | :sl:`padded boundary mode` - | :sg:`pad -> bool` - - If set True, then the text boundary rectangle will be inflated to match - that of font.Font. Otherwise, the boundary rectangle is just large - enough for the text. - - .. attribute:: ucs4 - - | :sl:`Enable UCS-4 mode` - | :sg:`ucs4 <-> bool` - - Gets or sets the decoding of Unicode text. By default, the - freetype module performs UTF-16 surrogate pair decoding on Unicode text. - This allows 32-bit escape sequences ('\Uxxxxxxxx') between 0x10000 and - 0x10FFFF to represent their corresponding UTF-32 code points on Python - interpreters built with a UCS-2 unicode type (on Windows, for instance). - It also means character values within the UTF-16 surrogate area (0xD800 - to 0xDFFF) are considered part of a surrogate pair. A malformed surrogate - pair will raise an UnicodeEncodeError. Setting ucs4 True turns surrogate - pair decoding off, letting interpreters with a UCS-4 unicode type access - the full UCS-4 character range. - - .. attribute:: resolution - - | :sl:`Pixel resolution in dots per inch` - | :sg:`resolution -> int` - - Gets the pixel size used in scaling font glyphs for this Font instance.
--- a/docs/_sources/ref/gfxdraw.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,264 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.gfxdraw` -===================== - -.. module:: pygame.gfxdraw - :synopsis: pygame module for drawing shapes - -| :sl:`pygame module for drawing shapes` - -EXPERIMENTAL!: meaning this api may change, or dissapear in later pygame -releases. If you use this, your code will break with the next pygame release. - -Draw several shapes to a surface. - -Most of the functions accept a color argument that is an ``RGB`` triplet. These -can also accept an ``RGBA`` quadruplet. The color argument can also be an -integer pixel value that is already mapped to the Surface's pixel format. - -For all functions the arguments are strictly positional. Only integers are -accepted for coordinates and radii. - -For functions like rectangle that accept a rect argument any (x, y, w, h) -sequence is accepted, though :mod:`pygame.Rect` instances are prefered. Note -that for a :mod:`pygame.Rect` the drawing will not include -``Rect.bottomright``. The right and bottom attributes of a Rect lie one pixel -outside of the Rect's boarder. - -To draw an anti aliased and filled shape, first use the aa* version of -the function, and then use the filled version. For example :: - - col = (255, 0, 0) - surf.fill((255, 255, 255)) - pygame.gfxdraw.aacircle(surf, x, y, 30, col) - pygame.gfxdraw.filled_circle(surf, x, y, 30, col) - -Note that pygame does not automatically import pygame.gfxdraw, so you need to -import pygame.gfxdraw before using it. - -Threading note: each of the functions releases the GIL during the C part of the call. - -The pygame.gfxdraw module differs from the draw module in the API it uses, and -also the different functions available to draw. It also wraps the primitives -from the library called SDL_gfx, rather than using modified versions. - - -New in pygame 1.9.0. - -.. function:: pixel - - | :sl:`place a pixel` - | :sg:`pixel(surface, x, y, color) -> None` - - Draws a single pixel onto a surface. - - .. ## pygame.gfxdraw.pixel ## - -.. function:: hline - - | :sl:`draw a horizontal line` - | :sg:`hline(surface, x1, x2, y, color) -> None` - - Draws a straight horizontal line on a Surface from x1 to x2 for - the given y coordinate. - - .. ## pygame.gfxdraw.hline ## - -.. function:: vline - - | :sl:`draw a vertical line` - | :sg:`vline(surface, x, y1, y2, color) -> None` - - Draws a straight vertical line on a Surface from y1 to y2 on - the given x coordinate. - - .. ## pygame.gfxdraw.vline ## - -.. function:: rectangle - - | :sl:`draw a rectangle` - | :sg:`rectangle(surface, rect, color) -> None` - - Draws the rectangle edges onto the surface. The given Rect is the area of the - rectangle. - - Keep in mind the ``Surface.fill()`` method works just as well for drawing - filled rectangles. In fact the ``Surface.fill()`` can be hardware - accelerated on some platforms with both software and hardware display modes. - - .. ## pygame.gfxdraw.rectangle ## - -.. function:: box - - | :sl:`draw a box` - | :sg:`box(surface, rect, color) -> None` - - Draws a box (a rect) onto a surface. - - .. ## pygame.gfxdraw.box ## - -.. function:: line - - | :sl:`draw a line` - | :sg:`line(surface, x1, y1, x2, y2, color) -> None` - - Draws a straight line on a Surface. There are no endcaps. - - .. ## pygame.gfxdraw.line ## - -.. function:: circle - - | :sl:`draw a circle` - | :sg:`circle(surface, x, y, r, color) -> None` - - Draws the edges of a circular shape on the Surface. The pos argument is - the center of the circle, and radius is the size. The circle is not - filled with color. - - .. ## pygame.gfxdraw.circle ## - -.. function:: arc - - | :sl:`draw an arc` - | :sg:`arc(surface, x, y, r, start, end, color) -> None` - - Draws an arc onto a surface. - - .. ## pygame.gfxdraw.arc ## - -.. function:: aacircle - - | :sl:`draw an anti-aliased circle` - | :sg:`aacircle(surface, x, y, r, color) -> None` - - Draws the edges of an anti aliased circle onto a surface. - - .. ## pygame.gfxdraw.aacircle ## - -.. function:: filled_circle - - | :sl:`draw a filled circle` - | :sg:`filled_circle(surface, x, y, r, color) -> None` - - Draws a filled circle onto a surface. So the inside of the circle will - be filled with the given color. - - .. ## pygame.gfxdraw.filled_circle ## - -.. function:: ellipse - - | :sl:`draw an ellipse` - | :sg:`ellipse(surface, x, y, rx, ry, color) -> None` - - Draws the edges of an ellipse onto a surface. - - .. ## pygame.gfxdraw.ellipse ## - -.. function:: aaellipse - - | :sl:`draw an anti-aliased ellipse` - | :sg:`aaellipse(surface, x, y, rx, ry, color) -> None` - - Draws anti aliased edges of an ellipse onto a surface. - - .. ## pygame.gfxdraw.aaellipse ## - -.. function:: filled_ellipse - - | :sl:`draw a filled ellipse` - | :sg:`filled_ellipse(surface, x, y, rx, ry, color) -> None` - - Draws a filled ellipse onto a surface. So the inside of the elipse will - be filled with the given color. - - .. ## pygame.gfxdraw.filled_ellipse ## - -.. function:: pie - - | :sl:`draw a pie` - | :sg:`pie(surface, x, y, r, start, end, color) -> None` - - Draws a pie onto the surface. - - .. ## pygame.gfxdraw.pie ## - -.. function:: trigon - - | :sl:`draw a triangle` - | :sg:`trigon(surface, x1, y1, x2, y2, x3, y3, color) -> None` - - Draws the edges of a trigon onto a surface. A trigon is a triangle. - - .. ## pygame.gfxdraw.trigon ## - -.. function:: aatrigon - - | :sl:`draw an anti-aliased triangle` - | :sg:`aatrigon(surface, x1, y1, x2, y2, x3, y3, color) -> None` - - Draws the anti aliased edges of a trigon onto a surface. A trigon is a triangle. - - .. ## pygame.gfxdraw.aatrigon ## - -.. function:: filled_trigon - - | :sl:`draw a filled trigon` - | :sg:`filled_trigon(surface, x1, y1, x2, y2, x3, y3, color) -> None` - - Draws a filled trigon onto a surface. So the inside of the trigon will - be filled with the given color. - - .. ## pygame.gfxdraw.filled_trigon ## - -.. function:: polygon - - | :sl:`draw a polygon` - | :sg:`polygon(surface, points, color) -> None` - - Draws the edges of a polygon onto a surface. - - .. ## pygame.gfxdraw.polygon ## - -.. function:: aapolygon - - | :sl:`draw an anti-aliased polygon` - | :sg:`aapolygon(surface, points, color) -> None` - - Draws the anti aliased edges of a polygon onto a surface. - - .. ## pygame.gfxdraw.aapolygon ## - -.. function:: filled_polygon - - | :sl:`draw a filled polygon` - | :sg:`filled_polygon(surface, points, color) -> None` - - Draws a filled polygon onto a surface. So the inside of the polygon will - be filled with the given color. - - .. ## pygame.gfxdraw.filled_polygon ## - -.. function:: textured_polygon - - | :sl:`draw a textured polygon` - | :sg:`textured_polygon(surface, points, texture, tx, ty) -> None` - - Draws a textured polygon onto a surface. - - A per-pixel alpha texture blit to a per-pixel alpha surface will differ from - a ``Surface.blit()`` blit. Also, a per-pixel alpha texture cannot be used - with an 8-bit per pixel destination. - - .. ## pygame.gfxdraw.textured_polygon ## - -.. function:: bezier - - | :sl:`draw a bezier curve` - | :sg:`bezier(surface, points, steps, color) -> None` - - Draws a bezier onto a surface. - - .. ## pygame.gfxdraw.bezier ## - -.. ## pygame.gfxdraw ##
--- a/docs/_sources/ref/image.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.image` -=================== - -.. module:: pygame.image - :synopsis: pygame module for image transfer - -| :sl:`pygame module for image transfer` - -The image module contains functions for loading and saving pictures, as well as -transferring Surfaces to formats usable by other packages. . - -Note that there is no Image class; an image is loaded as a Surface object. The -Surface class allows manipulation (drawing lines, setting pixels, capturing -regions, etc.). - -The image module is a required dependency of Pygame, but it only optionally -supports any extended file formats. By default it can only load uncompressed -``BMP`` images. When built with full image support, the ``pygame.image.load()`` -function can support the following formats. - - * ``JPG`` - - * ``PNG`` - - * ``GIF`` (non animated) - - * ``BMP`` - - * ``PCX`` - - * ``TGA`` (uncompressed) - - * ``TIF`` - - * ``LBM`` (and ``PBM``) - - * ``PBM`` (and ``PGM``, ``PPM``) - - * ``XPM`` - -Saving images only supports a limited set of formats. You can save to the -following formats. - - * ``BMP`` - - * ``TGA`` - - * ``PNG`` - - * ``JPEG`` - -``PNG``, ``JPEG`` saving new in pygame 1.8. - -.. function:: load - - | :sl:`load new image from a file` - | :sg:`load(filename) -> Surface` - | :sg:`load(fileobj, namehint="") -> Surface` - - Load an image from a file source. You can pass either a filename or a Python - file-like object. - - Pygame will automatically determine the image type (e.g., ``GIF`` or bitmap) - and create a new Surface object from the data. In some cases it will need to - know the file extension (e.g., ``GIF`` images should end in ".gif"). If you - pass a raw file-like object, you may also want to pass the original filename - as the namehint argument. - - The returned Surface will contain the same color format, colorkey and alpha - transparency as the file it came from. You will often want to call - ``Surface.convert()`` with no arguments, to create a copy that will draw - more quickly on the screen. - - For alpha transparency, like in .png images use the ``convert_alpha()`` - method after loading so that the image has per pixel transparency. - - Pygame may not always be built to support all image formats. At minimum it - will support uncompressed ``BMP``. If ``pygame.image.get_extended()`` - returns 'True', you should be able to load most images (including png, jpg - and gif). - - You should use ``os.path.join()`` for compatibility. - - :: - - eg. asurf = pygame.image.load(os.path.join('data', 'bla.png')) - - .. ## pygame.image.load ## - -.. function:: save - - | :sl:`save an image to disk` - | :sg:`save(Surface, filename) -> None` - - This will save your Surface as either a ``BMP``, ``TGA``, ``PNG``, or - ``JPEG`` image. If the filename extension is unrecognized it will default to - ``TGA``. Both ``TGA``, and ``BMP`` file formats create uncompressed files. - - ``PNG``, ``JPEG`` saving new in pygame 1.8. - - .. ## pygame.image.save ## - -.. function:: get_extended - - | :sl:`test if extended image formats can be loaded` - | :sg:`get_extended() -> bool` - - If pygame is built with extended image formats this function will return - True. It is still not possible to determine which formats will be available, - but generally you will be able to load them all. - - .. ## pygame.image.get_extended ## - -.. function:: tostring - - | :sl:`transfer image to string buffer` - | :sg:`tostring(Surface, format, flipped=False) -> string` - - Creates a string that can be transferred with the 'fromstring' method in - other Python imaging packages. Some Python image packages prefer their - images in bottom-to-top format (PyOpenGL for example). If you pass True for - the flipped argument, the string buffer will be vertically flipped. - - The format argument is a string of one of the following values. Note that - only 8bit Surfaces can use the "P" format. The other formats will work for - any Surface. Also note that other Python image packages support more formats - than Pygame. - - * ``P``, 8bit palettized Surfaces - - * ``RGB``, 24bit image - - * ``RGBX``, 32bit image with unused space - - * ``RGBA``, 32bit image with an alpha channel - - * ``ARGB``, 32bit image with alpha channel first - - * ``RGBA_PREMULT``, 32bit image with colors scaled by alpha channel - - * ``ARGB_PREMULT``, 32bit image with colors scaled by alpha channel, alpha channel first - - .. ## pygame.image.tostring ## - -.. function:: fromstring - - | :sl:`create new Surface from a string buffer` - | :sg:`fromstring(string, size, format, flipped=False) -> Surface` - - This function takes arguments similar to ``pygame.image.tostring()``. The - size argument is a pair of numbers representing the width and height. Once - the new Surface is created you can destroy the string buffer. - - The size and format image must compute the exact same size as the passed - string buffer. Otherwise an exception will be raised. - - See the ``pygame.image.frombuffer()`` method for a potentially faster way to - transfer images into Pygame. - - .. ## pygame.image.fromstring ## - -.. function:: frombuffer - - | :sl:`create a new Surface that shares data inside a string buffer` - | :sg:`frombuffer(string, size, format) -> Surface` - - Create a new Surface that shares pixel data directly from the string buffer. - This method takes the same arguments as ``pygame.image.fromstring()``, but - is unable to vertically flip the source data. - - This will run much faster than :func:`pygame.image.fromstring`, since no - pixel data must be allocated and copied. - - .. ## pygame.image.frombuffer ## - -.. ## pygame.image ##
--- a/docs/_sources/ref/joystick.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,273 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.joystick` -====================== - -.. module:: pygame.joystick - :synopsis: pygame module for interacting with joystick devices - -| :sl:`pygame module for interacting with joystick devices` - -The joystick module manages the joystick devices on a computer (there can be -more than one). Joystick devices include trackballs and video-game-style -gamepads, and the module allows the use of multiple buttons and "hats". - -To get initialise the joystick module and get a list of Joystick instances -use the following code:: - - pygame.joystick.init() - joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())] - -The following event types will be generated by the joysticks :: - - JOYAXISMOTION JOYBALLMOTION JOYBUTTONDOWN JOYBUTTONUP JOYHATMOTION - -The event queue needs to be pumped frequently for some of the methods to work. -So call one of pygame.event.get, pygame.event.wait, or pygame.event.pump regularly. - - -.. function:: init - - | :sl:`initialize the joystick module` - | :sg:`init() -> None` - - This function is called automatically by ``pygame.init()``. - - It initializes the joystick module. This will scan the system for all - joystick devices. The module must be initialized before any other functions - will work. - - It is safe to call this function more than once. - - .. ## pygame.joystick.init ## - -.. function:: quit - - | :sl:`uninitialize the joystick module` - | :sg:`quit() -> None` - - Uninitialize the joystick module. After you call this any existing joystick - objects will no longer work. - - It is safe to call this function more than once. - - .. ## pygame.joystick.quit ## - -.. function:: get_init - - | :sl:`true if the joystick module is initialized` - | :sg:`get_init() -> bool` - - Test if the ``pygame.joystick.init()`` function has been called. - - .. ## pygame.joystick.get_init ## - -.. function:: get_count - - | :sl:`number of joysticks on the system` - | :sg:`get_count() -> count` - - Return the number of joystick devices on the system. The count will be 0 if - there are no joysticks on the system. - - When you create Joystick objects using ``Joystick(id)``, you pass an integer - that must be lower than this count. - - .. ## pygame.joystick.get_count ## - -.. class:: Joystick - - | :sl:`create a new Joystick object` - | :sg:`Joystick(id) -> Joystick` - - Create a new joystick to access a physical device. The id argument must be a - value from 0 to pygame.joystick.get_count()-1. - - To access most of the Joystick methods, you'll need to ``init()`` the - Joystick. This is separate from making sure the joystick module is - initialized. When multiple Joysticks objects are created for the same - physical joystick device (i.e., they have the same ``ID`` number), the state - and values for those Joystick objects will be shared. - - The Joystick object allows you to get information about the types of - controls on a joystick device. Once the device is initialized the Pygame - event queue will start receiving events about its input. - - You can call the ``Joystick.get_name()`` and ``Joystick.get_id()`` functions - without initializing the Joystick object. - - .. method:: init - - | :sl:`initialize the Joystick` - | :sg:`init() -> None` - - The Joystick must be initialized to get most of the information about the - controls. While the Joystick is initialized the Pygame event queue will - receive events from the Joystick input. - - It is safe to call this more than once. - - .. ## Joystick.init ## - - .. method:: quit - - | :sl:`uninitialize the Joystick` - | :sg:`quit() -> None` - - This will unitialize a Joystick. After this the Pygame event queue will - no longer receive events from the device. - - It is safe to call this more than once. - - .. ## Joystick.quit ## - - .. method:: get_init - - | :sl:`check if the Joystick is initialized` - | :sg:`get_init() -> bool` - - Returns True if the ``init()`` method has already been called on this - Joystick object. - - .. ## Joystick.get_init ## - - .. method:: get_id - - | :sl:`get the Joystick ID` - | :sg:`get_id() -> int` - - Returns the integer ``ID`` that represents this device. This is the same - value that was passed to the ``Joystick()`` constructor. This method can - safely be called while the Joystick is not initialized. - - .. ## Joystick.get_id ## - - .. method:: get_name - - | :sl:`get the Joystick system name` - | :sg:`get_name() -> string` - - Returns the system name for this joystick device. It is unknown what name - the system will give to the Joystick, but it should be a unique name that - identifies the device. This method can safely be called while the - Joystick is not initialized. - - .. ## Joystick.get_name ## - - .. method:: get_numaxes - - | :sl:`get the number of axes on a Joystick` - | :sg:`get_numaxes() -> int` - - Returns the number of input axes are on a Joystick. There will usually be - two for the position. Controls like rudders and throttles are treated as - additional axes. - - The ``pygame.JOYAXISMOTION`` events will be in the range from -1.0 to - 1.0. A value of 0.0 means the axis is centered. Gamepad devices will - usually be -1, 0, or 1 with no values in between. Older analog joystick - axes will not always use the full -1 to 1 range, and the centered value - will be some area around 0. Analog joysticks usually have a bit of noise - in their axis, which will generate a lot of rapid small motion events. - - .. ## Joystick.get_numaxes ## - - .. method:: get_axis - - | :sl:`get the current position of an axis` - | :sg:`get_axis(axis_number) -> float` - - Returns the current position of a joystick axis. The value will range - from -1 to 1 with a value of 0 being centered. You may want to take into - account some tolerance to handle jitter, and joystick drift may keep the - joystick from centering at 0 or using the full range of position values. - - The axis number must be an integer from zero to get_numaxes()-1. - - .. ## Joystick.get_axis ## - - .. method:: get_numballs - - | :sl:`get the number of trackballs on a Joystick` - | :sg:`get_numballs() -> int` - - Returns the number of trackball devices on a Joystick. These devices work - similar to a mouse but they have no absolute position; they only have - relative amounts of movement. - - The ``pygame.JOYBALLMOTION`` event will be sent when the trackball is - rolled. It will report the amount of movement on the trackball. - - .. ## Joystick.get_numballs ## - - .. method:: get_ball - - | :sl:`get the relative position of a trackball` - | :sg:`get_ball(ball_number) -> x, y` - - Returns the relative movement of a joystick button. The value is a x, y - pair holding the relative movement since the last call to get_ball. - - The ball number must be an integer from zero to get_numballs()-1. - - .. ## Joystick.get_ball ## - - .. method:: get_numbuttons - - | :sl:`get the number of buttons on a Joystick` - | :sg:`get_numbuttons() -> int` - - Returns the number of pushable buttons on the joystick. These buttons - have a boolean (on or off) state. - - Buttons generate a ``pygame.JOYBUTTONDOWN`` and ``pygame.JOYBUTTONUP`` - event when they are pressed and released. - - .. ## Joystick.get_numbuttons ## - - .. method:: get_button - - | :sl:`get the current button state` - | :sg:`get_button(button) -> bool` - - Returns the current state of a joystick button. - - .. ## Joystick.get_button ## - - .. method:: get_numhats - - | :sl:`get the number of hat controls on a Joystick` - | :sg:`get_numhats() -> int` - - Returns the number of joystick hats on a Joystick. Hat devices are like - miniature digital joysticks on a joystick. Each hat has two axes of - input. - - The ``pygame.JOYHATMOTION`` event is generated when the hat changes - position. The position attribute for the event contains a pair of values - that are either -1, 0, or 1. A position of (0, 0) means the hat is - centered. - - .. ## Joystick.get_numhats ## - - .. method:: get_hat - - | :sl:`get the position of a joystick hat` - | :sg:`get_hat(hat_number) -> x, y` - - Returns the current position of a position hat. The position is given as - two values representing the ``X`` and ``Y`` position for the hat. (0, 0) - means centered. A value of -1 means left/down and a value of 1 means - right/up: so (-1, 0) means left; (1, 0) means right; (0, 1) means up; (1, - 1) means upper-right; etc. - - This value is digital, ``i.e.``, each coordinate can be -1, 0 or 1 but - never in-between. - - The hat number must be between 0 and get_numhats()-1. - - .. ## Joystick.get_hat ## - - .. ## pygame.joystick.Joystick ## - -.. ## pygame.joystick ##
--- a/docs/_sources/ref/key.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,264 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.key` -================= - -.. module:: pygame.key - :synopsis: pygame module to work with the keyboard - -| :sl:`pygame module to work with the keyboard` - -This module contains functions for dealing with the keyboard. - -The event queue gets ``pygame.KEYDOWN`` and ``pygame.KEYUP`` events when the -keyboard buttons are pressed and released. Both events have a key attribute -that is a integer id representing every key on the keyboard. - -The ``pygame.KEYDOWN`` event has an additional attributes unicode, and -scancode. unicode represents a single character string that is the fully -translated character entered. This takes into account the shift and composition -keys. scancode represents the platform specific key code. This could be -different from keyboard to keyboard, but is useful for key selection of weird -keys like the multimedia keys. - -There are many keyboard constants, they are used to represent keys on the -keyboard. The following is a list of all keyboard constants - -:: - - KeyASCII ASCII Common Name - K_BACKSPACE \b backspace - K_TAB \t tab - K_CLEAR clear - K_RETURN \r return - K_PAUSE pause - K_ESCAPE ^[ escape - K_SPACE space - K_EXCLAIM ! exclaim - K_QUOTEDBL " quotedbl - K_HASH # hash - K_DOLLAR $ dollar - K_AMPERSAND & ampersand - K_QUOTE quote - K_LEFTPAREN ( left parenthesis - K_RIGHTPAREN ) right parenthesis - K_ASTERISK * asterisk - K_PLUS + plus sign - K_COMMA , comma - K_MINUS - minus sign - K_PERIOD . period - K_SLASH / forward slash - K_0 0 0 - K_1 1 1 - K_2 2 2 - K_3 3 3 - K_4 4 4 - K_5 5 5 - K_6 6 6 - K_7 7 7 - K_8 8 8 - K_9 9 9 - K_COLON : colon - K_SEMICOLON ; semicolon - K_LESS < less-than sign - K_EQUALS = equals sign - K_GREATER > greater-than sign - K_QUESTION ? question mark - K_AT @ at - K_LEFTBRACKET [ left bracket - K_BACKSLASH \ backslash - K_RIGHTBRACKET ] right bracket - K_CARET ^ caret - K_UNDERSCORE _ underscore - K_BACKQUOTE ` grave - K_a a a - K_b b b - K_c c c - K_d d d - K_e e e - K_f f f - K_g g g - K_h h h - K_i i i - K_j j j - K_k k k - K_l l l - K_m m m - K_n n n - K_o o o - K_p p p - K_q q q - K_r r r - K_s s s - K_t t t - K_u u u - K_v v v - K_w w w - K_x x x - K_y y y - K_z z z - K_DELETE delete - K_KP0 keypad 0 - K_KP1 keypad 1 - K_KP2 keypad 2 - K_KP3 keypad 3 - K_KP4 keypad 4 - K_KP5 keypad 5 - K_KP6 keypad 6 - K_KP7 keypad 7 - K_KP8 keypad 8 - K_KP9 keypad 9 - K_KP_PERIOD . keypad period - K_KP_DIVIDE / keypad divide - K_KP_MULTIPLY * keypad multiply - K_KP_MINUS - keypad minus - K_KP_PLUS + keypad plus - K_KP_ENTER \r keypad enter - K_KP_EQUALS = keypad equals - K_UP up arrow - K_DOWN down arrow - K_RIGHT right arrow - K_LEFT left arrow - K_INSERT insert - K_HOME home - K_END end - K_PAGEUP page up - K_PAGEDOWN page down - K_F1 F1 - K_F2 F2 - K_F3 F3 - K_F4 F4 - K_F5 F5 - K_F6 F6 - K_F7 F7 - K_F8 F8 - K_F9 F9 - K_F10 F10 - K_F11 F11 - K_F12 F12 - K_F13 F13 - K_F14 F14 - K_F15 F15 - K_NUMLOCK numlock - K_CAPSLOCK capslock - K_SCROLLOCK scrollock - K_RSHIFT right shift - K_LSHIFT left shift - K_RCTRL right ctrl - K_LCTRL left ctrl - K_RALT right alt - K_LALT left alt - K_RMETA right meta - K_LMETA left meta - K_LSUPER left windows key - K_RSUPER right windows key - K_MODE mode shift - K_HELP help - K_PRINT print screen - K_SYSREQ sysrq - K_BREAK break - K_MENU menu - K_POWER power - K_EURO euro - -The keyboard also has a list of modifier states that can be assembled bit -bitwise ORing them together. - -:: - - KMOD_NONE, KMOD_LSHIFT, KMOD_RSHIFT, KMOD_SHIFT, KMOD_CAPS, - KMOD_LCTRL, KMOD_RCTRL, KMOD_CTRL, KMOD_LALT, KMOD_RALT, - KMOD_ALT, KMOD_LMETA, KMOD_RMETA, KMOD_META, KMOD_NUM, KMOD_MODE - -.. function:: get_focused - - | :sl:`true if the display is receiving keyboard input from the system` - | :sg:`get_focused() -> bool` - - This is true when the display window has keyboard focus from the system. If - the display needs to ensure it does not lose keyboard focus, it can use - ``pygame.event.set_grab()`` to grab all input. - - .. ## pygame.key.get_focused ## - -.. function:: get_pressed - - | :sl:`get the state of all keyboard buttons` - | :sg:`get_pressed() -> bools` - - Returns a sequence of boolean values representing the state of every key on - the keyboard. Use the key constant values to index the array. A True value - means the that button is pressed. - - Getting the list of pushed buttons with this function is not the proper way - to handle text entry from the user. You have no way to know the order of - keys pressed, and rapidly pushed keys can be completely unnoticed between - two calls to ``pygame.key.get_pressed()``. There is also no way to translate - these pushed keys into a fully translated character value. See the - ``pygame.KEYDOWN`` events on the event queue for this functionality. - - .. ## pygame.key.get_pressed ## - -.. function:: get_mods - - | :sl:`determine which modifier keys are being held` - | :sg:`get_mods() -> int` - - Returns a single integer representing a bitmask of all the modifier keys - being held. Using bitwise operators you can test if specific shift keys are - pressed, the state of the capslock button, and more. - - .. ## pygame.key.get_mods ## - -.. function:: set_mods - - | :sl:`temporarily set which modifier keys are pressed` - | :sg:`set_mods(int) -> None` - - Create a bitmask of the modifier constants you want to impose on your - program. - - .. ## pygame.key.set_mods ## - -.. function:: set_repeat - - | :sl:`control how held keys are repeated` - | :sg:`set_repeat() -> None` - | :sg:`set_repeat(delay, interval) -> None` - - When the keyboard repeat is enabled, keys that are held down will generate - multiple ``pygame.KEYDOWN`` events. The delay is the number of milliseconds - before the first repeated ``pygame.KEYDOWN`` will be sent. After that - another ``pygame.KEYDOWN`` will be sent every interval milliseconds. If no - arguments are passed the key repeat is disabled. - - When pygame is initialized the key repeat is disabled. - - .. ## pygame.key.set_repeat ## - -.. function:: get_repeat - - | :sl:`see how held keys are repeated` - | :sg:`get_repeat() -> (delay, interval)` - - When the keyboard repeat is enabled, keys that are held down will generate - multiple ``pygame.KEYDOWN`` events. The delay is the number of milliseconds - before the first repeated ``pygame.KEYDOWN`` will be sent. After that - another ``pygame.KEYDOWN`` will be sent every interval milliseconds. - - When pygame is initialized the key repeat is disabled. - - New in pygame 1.8. - - .. ## pygame.key.get_repeat ## - -.. function:: name - - | :sl:`get the name of a key identifier` - | :sg:`name(key) -> string` - - Get the descriptive name of the button from a keyboard button id constant. - - .. ## pygame.key.name ## - -.. ## pygame.key ##
--- a/docs/_sources/ref/locals.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.locals` -==================== - -.. module:: pygame.locals - :synopsis: pygame constants - -| :sl:`pygame constants` - -This module contains various constants used by Pygame. It's contents are -automatically placed in the pygame module namespace. However, an application -can use :mod:`pygame.locals` to include only the Pygame constants with a 'from -:mod:`pygame.locals` import \*'. - -Detailed descriptions of the various constants are found throughout the Pygame -documentation. :func:`pygame.display.set_mode` flags like ``HWSURFACE`` are -found in the Display section. Event types are explained in the Event section. -Keyboard ``K_`` constants relating to the key attribute of a ``KEYDOWN`` or -``KEYUP`` event are listed in the Key section. Also found there are the various -``MOD_`` key modifiers. Finally, ``TIMER_RESOLUTION`` is defined in Time. - -.. ## pygame.locals ##
--- a/docs/_sources/ref/mask.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.mask` -================== - -.. module:: pygame.mask - :synopsis: pygame module for image masks. - -| :sl:`pygame module for image masks.` - -Useful for fast pixel perfect collision detection. A Mask uses 1bit per pixel -to store which parts collide. - -New in pygame 1.8. - -.. function:: from_surface - - | :sl:`Returns a Mask from the given surface.` - | :sg:`from_surface(Surface, threshold = 127) -> Mask` - - Makes the transparent parts of the Surface not set, and the opaque parts - set. - - The alpha of each pixel is checked to see if it is greater than the given - threshold. - - If the Surface is color keyed, then threshold is not used. - - .. ## pygame.mask.from_surface ## - -.. function:: from_threshold - - | :sl:`Creates a mask by thresholding Surfaces` - | :sg:`from_threshold(Surface, color, threshold = (0,0,0,255), othersurface = None, palette_colors = 1) -> Mask` - - This is a more featureful method of getting a Mask from a Surface. If - supplied with only one Surface, all pixels within the threshold of the - supplied color are set in the Mask. If given the optional othersurface, all - pixels in Surface that are within the threshold of the corresponding pixel - in othersurface are set in the Mask. - - .. ## pygame.mask.from_threshold ## - -.. class:: Mask - - | :sl:`pygame object for representing 2d bitmasks` - | :sg:`Mask((width, height)) -> Mask` - - .. method:: get_size - - | :sl:`Returns the size of the mask.` - | :sg:`get_size() -> width,height` - - .. ## Mask.get_size ## - - .. method:: get_at - - | :sl:`Returns nonzero if the bit at (x,y) is set.` - | :sg:`get_at((x,y)) -> int` - - Coordinates start at (0,0) is top left - just like Surfaces. - - .. ## Mask.get_at ## - - .. method:: set_at - - | :sl:`Sets the position in the mask given by x and y.` - | :sg:`set_at((x,y),value) -> None` - - .. ## Mask.set_at ## - - .. method:: overlap - - | :sl:`Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.` - | :sg:`overlap(othermask, offset) -> x,y` - - The overlap tests uses the following offsets (which may be negative): - - :: - - +----+----------.. - |A | yoffset - | +-+----------.. - +--|B - |xoffset - | | - : : - - .. ## Mask.overlap ## - - .. method:: overlap_area - - | :sl:`Returns the number of overlapping 'pixels'.` - | :sg:`overlap_area(othermask, offset) -> numpixels` - - You can see how many pixels overlap with the other mask given. This can - be used to see in which direction things collide, or to see how much the - two masks collide. An approximate collision normal can be found by - calculating the gradient of the overlap area through the finite - difference. - - :: - - dx = Mask.overlap_area(othermask,(x+1,y)) - Mask.overlap_area(othermask,(x-1,y)) - dy = Mask.overlap_area(othermask,(x,y+1)) - Mask.overlap_area(othermask,(x,y-1)) - - .. ## Mask.overlap_area ## - - .. method:: overlap_mask - - | :sl:`Returns a mask of the overlapping pixels` - | :sg:`overlap_mask(othermask, offset) -> Mask` - - Returns a Mask the size of the original Mask containing only the - overlapping pixels between Mask and othermask. - - .. ## Mask.overlap_mask ## - - .. method:: fill - - | :sl:`Sets all bits to 1` - | :sg:`fill() -> None` - - Sets all bits in a Mask to 1. - - .. ## Mask.fill ## - - .. method:: clear - - | :sl:`Sets all bits to 0` - | :sg:`clear() -> None` - - Sets all bits in a Mask to 0. - - .. ## Mask.clear ## - - .. method:: invert - - | :sl:`Flips the bits in a Mask` - | :sg:`invert() -> None` - - Flips all of the bits in a Mask, so that the set pixels turn to unset - pixels and the unset pixels turn to set pixels. - - .. ## Mask.invert ## - - .. method:: scale - - | :sl:`Resizes a mask` - | :sg:`scale((x, y)) -> Mask` - - Returns a new Mask of the Mask scaled to the requested size. - - .. ## Mask.scale ## - - .. method:: draw - - | :sl:`Draws a mask onto another` - | :sg:`draw(othermask, offset) -> None` - - Performs a bitwise ``OR``, drawing othermask onto Mask. - - .. ## Mask.draw ## - - .. method:: erase - - | :sl:`Erases a mask from another` - | :sg:`erase(othermask, offset) -> None` - - Erases all pixels set in othermask from Mask. - - .. ## Mask.erase ## - - .. method:: count - - | :sl:`Returns the number of set pixels` - | :sg:`count() -> pixels` - - Returns the number of set pixels in the Mask. - - .. ## Mask.count ## - - .. method:: centroid - - | :sl:`Returns the centroid of the pixels in a Mask` - | :sg:`centroid() -> (x, y)` - - Finds the centroid, the center of pixel mass, of a Mask. Returns a - coordinate tuple for the centroid of the Mask. In the event the Mask is - empty, it will return (0,0). - - .. ## Mask.centroid ## - - .. method:: angle - - | :sl:`Returns the orientation of the pixels` - | :sg:`angle() -> theta` - - Finds the approximate orientation of the pixels in the image from -90 to - 90 degrees. This works best if performed on one connected component of - pixels. It will return 0.0 on an empty Mask. - - .. ## Mask.angle ## - - .. method:: outline - - | :sl:`list of points outlining an object` - | :sg:`outline(every = 1) -> [(x,y), (x,y) ...]` - - Returns a list of points of the outline of the first object it comes - across in a Mask. For this to be useful, there should probably only be - one connected component of pixels in the Mask. The every option allows - you to skip pixels in the outline. For example, setting it to 10 would - return a list of every 10th pixel in the outline. - - .. ## Mask.outline ## - - .. method:: convolve - - | :sl:`Return the convolution of self with another mask.` - | :sg:`convolve(othermask, outputmask = None, offset = (0,0)) -> Mask` - - Returns a mask with the (i-offset[0],j-offset[1]) bit set if shifting - othermask so that it's lower right corner pixel is at (i,j) would cause - it to overlap with self. - - If an outputmask is specified, the output is drawn onto outputmask and - outputmask is returned. Otherwise a mask of size ``self.get_size()`` + - ``othermask.get_size()`` - (1,1) is created. - - .. ## Mask.convolve ## - - .. method:: connected_component - - | :sl:`Returns a mask of a connected region of pixels.` - | :sg:`connected_component((x,y) = None) -> Mask` - - This uses the ``SAUF`` algorithm to find a connected component in the - Mask. It checks 8 point connectivity. By default, it will return the - largest connected component in the image. Optionally, a coordinate pair - of a pixel can be specified, and the connected component containing it - will be returned. In the event the pixel at that location is not set, the - returned Mask will be empty. The Mask returned is the same size as the - original Mask. - - .. ## Mask.connected_component ## - - .. method:: connected_components - - | :sl:`Returns a list of masks of connected regions of pixels.` - | :sg:`connected_components(min = 0) -> [Masks]` - - Returns a list of masks of connected regions of pixels. An optional - minimum number of pixels per connected region can be specified to filter - out noise. - - .. ## Mask.connected_components ## - - .. method:: get_bounding_rects - - | :sl:`Returns a list of bounding rects of regions of set pixels.` - | :sg:`get_bounding_rects() -> Rects` - - This gets a bounding rect of connected regions of set pixels. A bounding - rect is one for which each of the connected pixels is inside the rect. - - .. ## Mask.get_bounding_rects ## - - .. ## pygame.mask.Mask ## - -.. ## pygame.mask ##
--- a/docs/_sources/ref/math.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,525 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.math` -================== - -.. module:: pygame.math - :synopsis: pygame module for vector classes - -| :sl:`pygame module for vector classes` - -!!!EXPERIMENTAL!!! Note: This Modul is still in development and the ``API`` -might change. Please report bug and suggestions to pygame-users@seul.org - -The pygame math module currently provides Vector classes in two and three -dimensions, Vector2 and Vector3 respectively. - -They support the following numerical operations: vec+vec, vec-vec, vec*number, -number*vec, vec/number, vec//number, vec+=vec, vec-=vec, vec*=number, -vec/=number, vec//=number. All these operations will be performed elementwise. -In addition vec*vec will perform a scalar-product (a.k.a. dot-product). If you -want to multiply every element from vector v with every element from vector w -you can use the elementwise method: ``v.elementwise()`` ``\*`` w - -New in Pygame 1.10 - -.. function:: enable_swizzling - - | :sl:`globally enables swizzling for vectors.` - | :sg:`enable_swizzling() -> None` - - Enables swizzling for all vectors until ``disable_swizzling()`` is called. - By default swizzling is disabled. - - .. ## pygame.math.enable_swizzling ## - -.. function:: disable_swizzling - - | :sl:`globally disables swizzling for vectors.` - | :sg:`disable_swizzling() -> None` - - Disables swizzling for all vectors until ``enable_swizzling()`` is called. - By default swizzling is disabled. - - .. ## pygame.math.disable_swizzling ## - -.. class:: Vector2 - - | :sl:`a 2-Dimensional Vector` - | :sg:`Vector2() -> Vector2` - | :sg:`Vector2(Vector2) -> Vector2` - | :sg:`Vector2(x, y) -> Vector2` - | :sg:`Vector2((x, y)) -> Vector2` - - Some general information about the Vector2 class. - - .. method:: dot - - | :sl:`calculates the dot- or scalar-product with the other vector` - | :sg:`dot(Vector2) -> float` - - .. ## Vector2.dot ## - - .. method:: cross - - | :sl:`calculates the cross- or vector-product` - | :sg:`cross(Vector2) -> float` - - calculates the third component of the cross-product. - - .. ## Vector2.cross ## - - .. method:: length - - | :sl:`returns the euclidic length of the vector.` - | :sg:`length() -> float` - - calculates the euclidic length of the vector which follows from the - Pythagorean theorem: ``vec.length()`` == - ``math.sqrt(vec.x**2 + vec.y**2)`` - - .. ## Vector2.length ## - - .. method:: length_squared - - | :sl:`returns the squared euclidic length of the vector.` - | :sg:`length_squared() -> float` - - calculates the euclidic length of the vector which follows from the - Pythagorean theorem: ``vec.length_squared()`` == vec.x**2 + vec.y**2 This - is faster than ``vec.length()`` because it avoids the square root. - - .. ## Vector2.length_squared ## - - .. method:: normalize - - | :sl:`returns a vector with the same direction but length 1.` - | :sg:`normalize() -> Vector2` - - Returns a new vector that has length == 1 and the same direction as self. - - .. ## Vector2.normalize ## - - .. method:: normalize_ip - - | :sl:`normalizes the vector in place so that its length is 1.` - | :sg:`normalize_ip() -> None` - - Normalizes the vector so that it has length == 1. The direction of the - vector is not changed. - - .. ## Vector2.normalize_ip ## - - .. method:: is_normalized - - | :sl:`tests if the vector is normalized i.e. has length == 1.` - | :sg:`is_normalized() -> Bool` - - Returns True if the vector has length == 1. Otherwise it returns False. - - .. ## Vector2.is_normalized ## - - .. method:: scale_to_length - - | :sl:`scales the vector to a given length.` - | :sg:`scale_to_length(float) -> None` - - Scales the vector so that it has the given length. The direction of the - vector is not changed. You can also scale to length 0. If the vector is - the zero vector (i.e. has length 0 thus no direction) an - ZeroDivisionError is raised. - - .. ## Vector2.scale_to_length ## - - .. method:: reflect - - | :sl:`returns a vector reflected of a given normal.` - | :sg:`reflect(Vector2) -> Vector2` - - Returns a new vector that points in the direction as if self would bounce - of a surface characterized by the given surface normal. The length of the - new vector is the same as self's. - - .. ## Vector2.reflect ## - - .. method:: reflect_ip - - | :sl:`reflect the vector of a given normal in place.` - | :sg:`reflect_ip(Vector2) -> None` - - Changes the direction of self as if it would have been reflected of a - surface with the given surface normal. - - .. ## Vector2.reflect_ip ## - - .. method:: distance_to - - | :sl:`calculates the euclidic distance to a given vector.` - | :sg:`distance_to(Vector2) -> float` - - .. ## Vector2.distance_to ## - - .. method:: distance_squared_to - - | :sl:`calculates the squared euclidic distance to a given vector.` - | :sg:`distance_squared_to(Vector2) -> float` - - .. ## Vector2.distance_squared_to ## - - .. method:: lerp - - | :sl:`returns a linear interpolation to the given vector.` - | :sg:`lerp(Vector2, float) -> Vector2` - - Returns a Vector which is a linear interpolation between self and the - given Vector. The second parameter determines how far between self an - other the result is going to be. It must be a value between 0 and 1 where - 0 means self an 1 means other will be returned. - - .. ## Vector2.lerp ## - - .. method:: slerp - - | :sl:`returns a spherical interpolation to the given vector.` - | :sg:`slerp(Vector2, float) -> Vector2` - - Calculates the spherical interpolation from self to the given Vector. The - second argument - often called t - must be in the range [-1, 1]. It - parametrizes where - in between the two vectors - the result should be. - If a negative value is given the interpolation will not take the - complement of the shortest path. - - .. ## Vector2.slerp ## - - .. method:: elementwise - - | :sl:`The next operation will be performed elementwize.` - | :sg:`elementwise() -> VectorElementwizeProxy` - - Applies the following operation to each element of the vector. - - .. ## Vector2.elementwise ## - - .. method:: rotate - - | :sl:`rotates a vector by a given angle in degrees.` - | :sg:`rotate(float) -> Vector2` - - Returns a vector which has the same length as self but is rotated - counterclockwise by the given angle in degrees. - - .. ## Vector2.rotate ## - - .. method:: rotate_ip - - | :sl:`rotates the vector by a given angle in degrees in place.` - | :sg:`rotate_ip(float) -> None` - - Rotates the vector counterclockwise by the given angle in degrees. The - length of the vector is not changed. - - .. ## Vector2.rotate_ip ## - - .. method:: angle_to - - | :sl:`calculates the angle to a given vector in degrees.` - | :sg:`angle_to(Vector2) -> float` - - Returns the angle between self and the given vector. - - .. ## Vector2.angle_to ## - - .. method:: as_polar - - | :sl:`returns a tuple with radial distance and azimuthal angle.` - | :sg:`as_polar() -> (r, phi)` - - Returns a tuple (r, phi) where r is the radial distance, and phi is the - azimuthal angle. - - .. ## Vector2.as_polar ## - - .. method:: from_polar - - | :sl:`Sets x and y from a polar coordinates tuple.` - | :sg:`from_polar((r, phi)) -> None` - - Sets x and y from a tuple (r, phi) where r is the radial distance, and - phi is the azimuthal angle. - - .. ## Vector2.from_polar ## - - .. ## pygame.math.Vector2 ## - -.. class:: Vector3 - - | :sl:`a 3-Dimensional Vector` - | :sg:`Vector3() -> Vector3` - | :sg:`Vector3(Vector3) -> Vector3` - | :sg:`Vector3(x, y, z) -> Vector3` - | :sg:`Vector3((x, y, z)) -> Vector3` - - Some general information about the Vector3 class. - - .. method:: dot - - | :sl:`calculates the dot- or scalar-product with the other vector` - | :sg:`dot(Vector3) -> float` - - .. ## Vector3.dot ## - - .. method:: cross - - | :sl:`calculates the cross- or vector-product` - | :sg:`cross(Vector3) -> float` - - calculates the cross-product. - - .. ## Vector3.cross ## - - .. method:: length - - | :sl:`returns the euclidic length of the vector.` - | :sg:`length() -> float` - - calculates the euclidic length of the vector which follows from the - Pythagorean theorem: ``vec.length()`` == - ``math.sqrt(vec.x**2 + vec.y**2 + vec.z**2)`` - - .. ## Vector3.length ## - - .. method:: length_squared - - | :sl:`returns the squared euclidic length of the vector.` - | :sg:`length_squared() -> float` - - calculates the euclidic length of the vector which follows from the - Pythagorean theorem: ``vec.length_squared()`` == vec.x**2 + vec.y**2 + - vec.z**2 This is faster than ``vec.length()`` because it avoids the - square root. - - .. ## Vector3.length_squared ## - - .. method:: normalize - - | :sl:`returns a vector with the same direction but length 1.` - | :sg:`normalize() -> Vector3` - - Returns a new vector that has length == 1 and the same direction as self. - - .. ## Vector3.normalize ## - - .. method:: normalize_ip - - | :sl:`normalizes the vector in place so that its length is 1.` - | :sg:`normalize_ip() -> None` - - Normalizes the vector so that it has length == 1. The direction of the - vector is not changed. - - .. ## Vector3.normalize_ip ## - - .. method:: is_normalized - - | :sl:`tests if the vector is normalized i.e. has length == 1.` - | :sg:`is_normalized() -> Bool` - - Returns True if the vector has length == 1. Otherwise it returns False. - - .. ## Vector3.is_normalized ## - - .. method:: scale_to_length - - | :sl:`scales the vector to a given length.` - | :sg:`scale_to_length(float) -> None` - - Scales the vector so that it has the given length. The direction of the - vector is not changed. You can also scale to length 0. If the vector is - the zero vector (i.e. has length 0 thus no direction) an - ZeroDivisionError is raised. - - .. ## Vector3.scale_to_length ## - - .. method:: reflect - - | :sl:`returns a vector reflected of a given normal.` - | :sg:`reflect(Vector3) -> Vector3` - - Returns a new vector that points in the direction as if self would bounce - of a surface characterized by the given surface normal. The length of the - new vector is the same as self's. - - .. ## Vector3.reflect ## - - .. method:: reflect_ip - - | :sl:`reflect the vector of a given normal in place.` - | :sg:`reflect_ip(Vector3) -> None` - - Changes the direction of self as if it would have been reflected of a - surface with the given surface normal. - - .. ## Vector3.reflect_ip ## - - .. method:: distance_to - - | :sl:`calculates the euclidic distance to a given vector.` - | :sg:`distance_to(Vector3) -> float` - - .. ## Vector3.distance_to ## - - .. method:: distance_squared_to - - | :sl:`calculates the squared euclidic distance to a given vector.` - | :sg:`distance_squared_to(Vector3) -> float` - - .. ## Vector3.distance_squared_to ## - - .. method:: lerp - - | :sl:`returns a linear interpolation to the given vector.` - | :sg:`lerp(Vector3, float) -> Vector3` - - Returns a Vector which is a linear interpolation between self and the - given Vector. The second parameter determines how far between self an - other the result is going to be. It must be a value between 0 and 1 where - 0 means self an 1 means other will be returned. - - .. ## Vector3.lerp ## - - .. method:: slerp - - | :sl:`returns a spherical interpolation to the given vector.` - | :sg:`slerp(Vector3, float) -> Vector3` - - Calculates the spherical interpolation from self to the given Vector. The - second argument - often called t - must be in the range [-1, 1]. It - parametrizes where - in between the two vectors - the result should be. - If a negative value is given the interpolation will not take the - complement of the shortest path. - - .. ## Vector3.slerp ## - - .. method:: elementwise - - | :sl:`The next operation will be performed elementwize.` - | :sg:`elementwise() -> VectorElementwizeProxy` - - Applies the following operation to each element of the vector. - - .. ## Vector3.elementwise ## - - .. method:: rotate - - | :sl:`rotates a vector by a given angle in degrees.` - | :sg:`rotate(Vector3, float) -> Vector3` - - Returns a vector which has the same length as self but is rotated - counterclockwise by the given angle in degrees around the given axis. - - .. ## Vector3.rotate ## - - .. method:: rotate_ip - - | :sl:`rotates the vector by a given angle in degrees in place.` - | :sg:`rotate_ip(Vector3, float) -> None` - - Rotates the vector counterclockwise around the given axis by the given - angle in degrees. The length of the vector is not changed. - - .. ## Vector3.rotate_ip ## - - .. method:: rotate_x - - | :sl:`rotates a vector around the x-axis by the angle in degrees.` - | :sg:`rotate_x(float) -> Vector3` - - Returns a vector which has the same length as self but is rotated - counterclockwise around the x-axis by the given angle in degrees. - - .. ## Vector3.rotate_x ## - - .. method:: rotate_x_ip - - | :sl:`rotates the vector around the x-axis by the angle in degrees in place.` - | :sg:`rotate_x_ip(float) -> None` - - Rotates the vector counterclockwise around the x-axis by the given angle - in degrees. The length of the vector is not changed. - - .. ## Vector3.rotate_x_ip ## - - .. method:: rotate_y - - | :sl:`rotates a vector around the y-axis by the angle in degrees.` - | :sg:`rotate_y(float) -> Vector3` - - Returns a vector which has the same length as self but is rotated - counterclockwise around the y-axis by the given angle in degrees. - - .. ## Vector3.rotate_y ## - - .. method:: rotate_y_ip - - | :sl:`rotates the vector around the y-axis by the angle in degrees in place.` - | :sg:`rotate_y_ip(float) -> None` - - Rotates the vector counterclockwise around the y-axis by the given angle - in degrees. The length of the vector is not changed. - - .. ## Vector3.rotate_y_ip ## - - .. method:: rotate_z - - | :sl:`rotates a vector around the z-axis by the angle in degrees.` - | :sg:`rotate_z(float) -> Vector3` - - Returns a vector which has the same length as self but is rotated - counterclockwise around the z-axis by the given angle in degrees. - - .. ## Vector3.rotate_z ## - - .. method:: rotate_z_ip - - | :sl:`rotates the vector around the z-axis by the angle in degrees in place.` - | :sg:`rotate_z_ip(float) -> None` - - Rotates the vector counterclockwise around the z-axis by the given angle - in degrees. The length of the vector is not changed. - - .. ## Vector3.rotate_z_ip ## - - .. method:: angle_to - - | :sl:`calculates the angle to a given vector in degrees.` - | :sg:`angle_to(Vector3) -> float` - - Returns the angle between self and the given vector. - - .. ## Vector3.angle_to ## - - .. method:: as_spherical - - | :sl:`returns a tuple with radial distance, inclination and azimuthal angle.` - | :sg:`as_spherical() -> (r, theta, phi)` - - Returns a tuple (r, theta, phi) where r is the radial distance, theta is - the inclination angle and phi is the azimuthal angle. - - .. ## Vector3.as_spherical ## - - .. method:: from_spherical - - | :sl:`Sets x, y and z from a spherical coordinates 3-tuple.` - | :sg:`from_spherical((r, theta, phi)) -> None` - - Sets x, y and z from a tuple (r, theta, phi) where r is the radial - distance, theta is the inclination angle and phi is the azimuthal angle. - - .. ## Vector3.from_spherical ## - - .. ## ## - - .. ## pygame.math.Vector3 ## - -.. ## pygame.math ##
--- a/docs/_sources/ref/midi.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,411 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.midi` -================== - -.. module:: pygame.midi - :synopsis: pygame module for interacting with midi input and output. - -| :sl:`pygame module for interacting with midi input and output.` - -The midi module can send output to midi devices, and get input from midi -devices. It can also list midi devices on the system. - -Including real midi devices, and virtual ones. - -It uses the portmidi library. Is portable to which ever platforms portmidi -supports (currently windows, ``OSX``, and linux). - -This uses pyportmidi for now, but may use its own bindings at some point in the -future. The pyportmidi bindings are included with pygame. - -New in pygame 1.9.0. - -.. class:: Input - - | :sl:`Input is used to get midi input from midi devices.` - | :sg:`Input(device_id) -> None` - | :sg:`Input(device_id, buffer_size) -> None` - - buffer_size -the number of input events to be buffered waiting to - - :: - - be read using Input.read() - - .. method:: close - - | :sl:`closes a midi stream, flushing any pending buffers.` - | :sg:`close() -> None` - - PortMidi attempts to close open streams when the application exits -- - this is particularly difficult under Windows. - - .. ## Input.close ## - - .. method:: poll - - | :sl:`returns true if there's data, or false if not.` - | :sg:`poll() -> Bool` - - raises a MidiException on error. - - .. ## Input.poll ## - - .. method:: read - - | :sl:`reads num_events midi events from the buffer.` - | :sg:`read(num_events) -> midi_event_list` - - Reads from the Input buffer and gives back midi events. - [[[status,data1,data2,data3],timestamp], - - :: - - [[status,data1,data2,data3],timestamp],...] - - .. ## Input.read ## - - .. ## pygame.midi.Input ## - -.. function:: MidiException - - | :sl:`exception that pygame.midi functions and classes can raise` - | :sg:`MidiException(errno) -> None` - - .. ## pygame.midi.MidiException ## - -.. class:: Output - - | :sl:`Output is used to send midi to an output device` - | :sg:`Output(device_id) -> None` - | :sg:`Output(device_id, latency = 0) -> None` - | :sg:`Output(device_id, buffer_size = 4096) -> None` - | :sg:`Output(device_id, latency, buffer_size) -> None` - - The buffer_size specifies the number of output events to be buffered waiting - for output. (In some cases -- see below -- PortMidi does not buffer output - at all and merely passes data to a lower-level ``API``, in which case - buffersize is ignored.) - - latency is the delay in milliseconds applied to timestamps to determine when - the output should actually occur. (If latency is <<0, 0 is assumed.) - - If latency is zero, timestamps are ignored and all output is delivered - immediately. If latency is greater than zero, output is delayed until the - message timestamp plus the latency. (NOTE: time is measured relative to the - time source indicated by time_proc. Timestamps are absolute, not relative - delays or offsets.) In some cases, PortMidi can obtain better timing than - your application by passing timestamps along to the device driver or - hardware. Latency may also help you to synchronize midi data to audio data - by matching midi latency to the audio buffer latency. - - .. method:: abort - - | :sl:`terminates outgoing messages immediately` - | :sg:`abort() -> None` - - The caller should immediately close the output port; this call may result - in transmission of a partial midi message. There is no abort for Midi - input because the user can simply ignore messages in the buffer and close - an input device at any time. - - .. ## Output.abort ## - - .. method:: close - - | :sl:`closes a midi stream, flushing any pending buffers.` - | :sg:`close() -> None` - - PortMidi attempts to close open streams when the application exits -- - this is particularly difficult under Windows. - - .. ## Output.close ## - - .. method:: note_off - - | :sl:`turns a midi note off. Note must be on.` - | :sg:`note_off(note, velocity=None, channel = 0) -> None` - - Turn a note off in the output stream. The note must already be on for - this to work correctly. - - .. ## Output.note_off ## - - .. method:: note_on - - | :sl:`turns a midi note on. Note must be off.` - | :sg:`note_on(note, velocity=None, channel = 0) -> None` - - Turn a note on in the output stream. The note must already be off for - this to work correctly. - - .. ## Output.note_on ## - - .. method:: set_instrument - - | :sl:`select an instrument, with a value between 0 and 127` - | :sg:`set_instrument(instrument_id, channel = 0) -> None` - - .. ## Output.set_instrument ## - - .. method:: write - - | :sl:`writes a list of midi data to the Output` - | :sg:`write(data) -> None` - - writes series of ``MIDI`` information in the form of a list: - - :: - - write([[[status <,data1><,data2><,data3>],timestamp], - [[status <,data1><,data2><,data3>],timestamp],...]) - - <<ata> fields are optional example: choose program change 1 at time 20000 - and send note 65 with velocity 100 500 ms later. - - :: - - write([[[0xc0,0,0],20000],[[0x90,60,100],20500]]) - - notes: - - :: - - 1. timestamps will be ignored if latency = 0. - 2. To get a note to play immediately, send MIDI info with - timestamp read from function Time. - 3. understanding optional data fields: - write([[[0xc0,0,0],20000]]) is equivalent to - write([[[0xc0],20000]]) - - Can send up to 1024 elements in your data list, otherwise an - - :: - - IndexError exception is raised. - - .. ## Output.write ## - - .. method:: write_short - - | :sl:`write_short(status <, data1><, data2>)` - | :sg:`write_short(status) -> None` - | :sg:`write_short(status, data1 = 0, data2 = 0) -> None` - - output ``MIDI`` information of 3 bytes or less. data fields are optional - status byte could be: - - :: - - 0xc0 = program change - 0x90 = note on - etc. - data bytes are optional and assumed 0 if omitted - - example: note 65 on with velocity 100 - - :: - - write_short(0x90,65,100) - - .. ## Output.write_short ## - - .. method:: write_sys_ex - - | :sl:`writes a timestamped system-exclusive midi message.` - | :sg:`write_sys_ex(when, msg) -> None` - - msg - can be a \*list* or a \*string* when - a timestamp in miliseconds - example: - - :: - - (assuming o is an onput MIDI stream) - o.write_sys_ex(0,'\xF0\x7D\x10\x11\x12\x13\xF7') - is equivalent to - o.write_sys_ex(pygame.midi.time(), - [0xF0,0x7D,0x10,0x11,0x12,0x13,0xF7]) - - .. ## Output.write_sys_ex ## - - .. ## pygame.midi.Output ## - -.. function:: get_count - - | :sl:`gets the number of devices.` - | :sg:`get_count() -> num_devices` - - Device ids range from 0 to ``get_count()`` -1 - - .. ## pygame.midi.get_count ## - -.. function:: get_default_input_id - - | :sl:`gets default input device number` - | :sg:`get_default_input_id() -> default_id` - - Return the default device ``ID`` or -1 if there are no devices. The result - can be passed to the Input()/Ouput() class. - - On the ``PC``, the user can specify a default device by setting an - environment variable. For example, to use device #1. - - :: - - set PM_RECOMMENDED_INPUT_DEVICE=1 - - The user should first determine the available device ``ID`` by using the - supplied application "testin" or "testout". - - In general, the registry is a better place for this kind of info, and with - ``USB`` devices that can come and go, using integers is not very reliable - for device identification. Under Windows, if - ``PM_RECOMMENDED_OUTPUT_DEVICE`` (or ``PM_RECOMMENDED_INPUT_DEVICE``) is - \*NOT* found in the environment, then the default device is obtained by - looking for a string in the registry under: - - :: - - HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device - - and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device for a - string. The number of the first device with a substring that matches the - string exactly is returned. For example, if the string in the registry is - "USB", and device 1 is named "In ``USB`` MidiSport 1x1", then that will be - the default input because it contains the string "USB". - - In addition to the name, ``get_device_info()`` returns "interf", which is - the interface name. (The "interface" is the underlying software system or - ``API`` used by PortMidi to access devices. Examples are MMSystem, DirectX - (not implemented), ``ALSA``, ``OSS`` (not implemented), etc.) At present, - the only Win32 interface is "MMSystem", the only Linux interface is "ALSA", - and the only Max ``OS`` ``X`` interface is "CoreMIDI". To specify both the - interface and the device name in the registry, separate the two with a comma - and a space, ``e.g.``: - - :: - - MMSystem, In USB MidiSport 1x1 - - In this case, the string before the comma must be a substring of the - "interf" string, and the string after the space must be a substring of the - "name" name string in order to match the device. - - Note: in the current release, the default is simply the first device (the - input or output device with the lowest PmDeviceID). - - .. ## pygame.midi.get_default_input_id ## - -.. function:: get_default_output_id - - | :sl:`gets default output device number` - | :sg:`get_default_output_id() -> default_id` - - Return the default device ``ID`` or -1 if there are no devices. The result - can be passed to the Input()/Ouput() class. - - On the ``PC``, the user can specify a default device by setting an - environment variable. For example, to use device #1. - - :: - - set PM_RECOMMENDED_OUTPUT_DEVICE=1 - - The user should first determine the available device ``ID`` by using the - supplied application "testin" or "testout". - - In general, the registry is a better place for this kind of info, and with - ``USB`` devices that can come and go, using integers is not very reliable - for device identification. Under Windows, if - ``PM_RECOMMENDED_OUTPUT_DEVICE`` (or ``PM_RECOMMENDED_INPUT_DEVICE``) is - \*NOT* found in the environment, then the default device is obtained by - looking for a string in the registry under: - - :: - - HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Input_Device - - and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device for a - string. The number of the first device with a substring that matches the - string exactly is returned. For example, if the string in the registry is - "USB", and device 1 is named "In ``USB`` MidiSport 1x1", then that will be - the default input because it contains the string "USB". - - In addition to the name, ``get_device_info()`` returns "interf", which is - the interface name. (The "interface" is the underlying software system or - ``API`` used by PortMidi to access devices. Examples are MMSystem, DirectX - (not implemented), ``ALSA``, ``OSS`` (not implemented), etc.) At present, - the only Win32 interface is "MMSystem", the only Linux interface is "ALSA", - and the only Max ``OS`` ``X`` interface is "CoreMIDI". To specify both the - interface and the device name in the registry, separate the two with a comma - and a space, ``e.g.``: - - :: - - MMSystem, In USB MidiSport 1x1 - - In this case, the string before the comma must be a substring of the - "interf" string, and the string after the space must be a substring of the - "name" name string in order to match the device. - - Note: in the current release, the default is simply the first device (the - input or output device with the lowest PmDeviceID). - - .. ## pygame.midi.get_default_output_id ## - -.. function:: get_device_info - - | :sl:`returns information about a midi device` - | :sg:`get_device_info(an_id) -> (interf, name, input, output, opened)` - - interf - a text string describing the device interface, eg 'ALSA'. name - a - text string for the name of the device, eg 'Midi Through Port-0' input - 0, - or 1 if the device is an input device. output - 0, or 1 if the device is an - output device. opened - 0, or 1 if the device is opened. - - If the id is out of range, the function returns None. - - .. ## pygame.midi.get_device_info ## - -.. function:: init - - | :sl:`initialize the midi module` - | :sg:`init() -> None` - - Call the initialisation function before using the midi module. - - It is safe to call this more than once. - - .. ## pygame.midi.init ## - -.. function:: midis2events - - | :sl:`converts midi events to pygame events` - | :sg:`midis2events(midis, device_id) -> [Event, ...]` - - Takes a sequence of midi events and returns list of pygame events. - - .. ## pygame.midi.midis2events ## - -.. function:: quit - - | :sl:`uninitialize the midi module` - | :sg:`quit() -> None` - - Called automatically atexit if you don't call it. - - It is safe to call this function more than once. - - .. ## pygame.midi.quit ## - -.. function:: time - - | :sl:`returns the current time in ms of the PortMidi timer` - | :sg:`time() -> time` - - The time is reset to 0, when the module is inited. - - .. ## pygame.midi.time ## - -.. ## pygame.midi ##
--- a/docs/_sources/ref/mixer.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,551 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.mixer` -=================== - -.. module:: pygame.mixer - :synopsis: pygame module for loading and playing sounds - -| :sl:`pygame module for loading and playing sounds` - -This module contains classes for loading Sound objects and controlling -playback. The mixer module is optional and depends on SDL_mixer. Your program -should test that :mod:`pygame.mixer` is available and intialized before using -it. - -The mixer module has a limited number of channels for playback of sounds. -Usually programs tell pygame to start playing audio and it selects an available -channel automatically. The default is 8 simultaneous channels, but complex -programs can get more precise control over the number of channels and their -use. - -All sound playback is mixed in background threads. When you begin to play a -Sound object, it will return immediately while the sound continues to play. A -single Sound object can also be actively played back multiple times. - -The mixer also has a special streaming channel. This is for music playback and -is accessed through the :mod:`pygame.mixer.music` module. - -The mixer module must be initialized like other pygame modules, but it has some -extra conditions. The ``pygame.mixer.init()`` function takes several optional -arguments to control the playback rate and sample size. Pygame will default to -reasonable values, but pygame cannot perform Sound resampling, so the mixer -should be initialized to match the values of your audio resources. - -``NOTE``: Not to get less laggy sound, use a smaller buffer size. The default -is set to reduce the chance of scratchy sounds on some computers. You can -change the default buffer by calling :func:`pygame.mixer.pre_init` before -:func:`pygame.mixer.init` or :func:`pygame.init` is called. For example: -``pygame.mixer.pre_init(44100,-16,2, 1024)`` The default size was changed from -1024 to 3072 in pygame 1.8. - -.. function:: init - - | :sl:`initialize the mixer module` - | :sg:`init(frequency=22050, size=-16, channels=2, buffer=4096) -> None` - - Initialize the mixer module for Sound loading and playback. The default - arguments can be overridden to provide specific audio mixing. Keyword - arguments are accepted. For backward compatibility where an argument is set - zero the default value is used (possible changed by a pre_init call). - - The size argument represents how many bits are used for each audio sample. - If the value is negative then signed sample values will be used. Positive - values mean unsigned audio samples will be used. An invalid value raises an - exception. - - The channels argument is used to specify whether to use mono or stereo. 1 - for mono and 2 for stereo. No other values are supported (negative values - are treated as 1, values greater than 2 as 2). - - The buffer argument controls the number of internal samples used in the - sound mixer. The default value should work for most cases. It can be lowered - to reduce latency, but sound dropout may occur. It can be raised to larger - values to ensure playback never skips, but it will impose latency on sound - playback. The buffer size must be a power of two (if not it is rounded up to - the next nearest power of 2). - - Some platforms require the :mod:`pygame.mixer` module to be initialized - after the display modules have initialized. The top level ``pygame.init()`` - takes care of this automatically, but cannot pass any arguments to the mixer - init. To solve this, mixer has a function ``pygame.mixer.pre_init()`` to set - the proper defaults before the toplevel init is used. - - It is safe to call this more than once, but after the mixer is initialized - you cannot change the playback arguments without first calling - ``pygame.mixer.quit()``. - - .. ## pygame.mixer.init ## - -.. function:: pre_init - - | :sl:`preset the mixer init arguments` - | :sg:`pre_init(frequency=22050, size=-16, channels=2, buffersize=4096) -> None` - - Call pre_init to change the defaults used when the real - ``pygame.mixer.init()`` is called. Keyword arguments are accepted. The best - way to set custom mixer playback values is to call - ``pygame.mixer.pre_init()`` before calling the top level ``pygame.init()``. - For backward compatibility argument values of zero is replaced with the - startup defaults. - - .. ## pygame.mixer.pre_init ## - -.. function:: quit - - | :sl:`uninitialize the mixer` - | :sg:`quit() -> None` - - This will uninitialize :mod:`pygame.mixer`. All playback will stop and any - loaded Sound objects may not be compatible with the mixer if it is - reinitialized later. - - .. ## pygame.mixer.quit ## - -.. function:: get_init - - | :sl:`test if the mixer is initialized` - | :sg:`get_init() -> (frequency, format, channels)` - - If the mixer is initialized, this returns the playback arguments it is - using. If the mixer has not been initialized this returns None - - .. ## pygame.mixer.get_init ## - -.. function:: stop - - | :sl:`stop playback of all sound channels` - | :sg:`stop() -> None` - - This will stop all playback of all active mixer channels. - - .. ## pygame.mixer.stop ## - -.. function:: pause - - | :sl:`temporarily stop playback of all sound channels` - | :sg:`pause() -> None` - - This will temporarily stop all playback on the active mixer channels. The - playback can later be resumed with ``pygame.mixer.unpause()`` - - .. ## pygame.mixer.pause ## - -.. function:: unpause - - | :sl:`resume paused playback of sound channels` - | :sg:`unpause() -> None` - - This will resume all active sound channels after they have been paused. - - .. ## pygame.mixer.unpause ## - -.. function:: fadeout - - | :sl:`fade out the volume on all sounds before stopping` - | :sg:`fadeout(time) -> None` - - This will fade out the volume on all active channels over the time argument - in milliseconds. After the sound is muted the playback will stop. - - .. ## pygame.mixer.fadeout ## - -.. function:: set_num_channels - - | :sl:`set the total number of playback channels` - | :sg:`set_num_channels(count) -> None` - - Sets the number of available channels for the mixer. The default value is 8. - The value can be increased or decreased. If the value is decreased, sounds - playing on the truncated channels are stopped. - - .. ## pygame.mixer.set_num_channels ## - -.. function:: get_num_channels - - | :sl:`get the total number of playback channels` - | :sg:`get_num_channels() -> count` - - Returns the number of currently active playback channels. - - .. ## pygame.mixer.get_num_channels ## - -.. function:: set_reserved - - | :sl:`reserve channels from being automatically used` - | :sg:`set_reserved(count) -> None` - - The mixer can reserve any number of channels that will not be automatically - selected for playback by Sounds. If sounds are currently playing on the - reserved channels they will not be stopped. - - This allows the application to reserve a specific number of channels for - important sounds that must not be dropped or have a guaranteed channel to - play on. - - .. ## pygame.mixer.set_reserved ## - -.. function:: find_channel - - | :sl:`find an unused channel` - | :sg:`find_channel(force=False) -> Channel` - - This will find and return an inactive Channel object. If there are no - inactive Channels this function will return None. If there are no inactive - channels and the force argument is True, this will find the Channel with the - longest running Sound and return it. - - If the mixer has reserved channels from ``pygame.mixer.set_reserved()`` then - those channels will not be returned here. - - .. ## pygame.mixer.find_channel ## - -.. function:: get_busy - - | :sl:`test if any sound is being mixed` - | :sg:`get_busy() -> bool` - - Returns True if the mixer is busy mixing any channels. If the mixer is idle - then this return False. - - .. ## pygame.mixer.get_busy ## - -.. class:: Sound - - | :sl:`Create a new Sound object from a file or buffer object` - | :sg:`Sound(filename) -> Sound` - | :sg:`Sound(file=filename) -> Sound` - | :sg:`Sound(buffer) -> Sound` - | :sg:`Sound(buffer=buffer) -> Sound` - | :sg:`Sound(object) -> Sound` - | :sg:`Sound(file=object) -> Sound` - | :sg:`Sound(array=object) -> Sound` - - Load a new sound buffer from a filename, a python file object or a readable - buffer object. Limited resampling will be performed to help the sample match - the initialize arguments for the mixer. A Unicode string can only be a file - pathname. A Python 2.x string or a Python 3.x bytes object can be either a - pathname or a buffer object. Use the 'file' or 'buffer' keywords to avoid - ambiguity; otherwise Sound may guess wrong. If the array keyword is used, - the object is expected to export a version 3, ``C`` level array interface - or, for Python 2.6 or later, a new buffer interface (The object is checked - for a buffer interface first.) - - The Sound object represents actual sound sample data. Methods that change - the state of the Sound object will the all instances of the Sound playback. - A Sound object also exports an array interface, and, for Python 2.6 or - later, a new buffer interface. - - The Sound can be loaded from an ``OGG`` audio file or from an uncompressed - ``WAV``. - - Note: The buffer will be copied internally, no data will be shared between - it and the Sound object. - - For now buffer and array support is consistent with ``sndarray.make_sound`` - for Numeric arrays, in that sample sign and byte order are ignored. This - will change, either by correctly handling sign and byte order, or by raising - an exception when different. Also, source samples are truncated to fit the - audio sample size. This will not change. - - ``pygame.mixer.Sound(buffer)`` is new in pygame 1.8 - :class:`pygame.mixer.Sound` keyword arguments and array interface support - new in pygame 1.9.2 - - .. method:: play - - | :sl:`begin sound playback` - | :sg:`play(loops=0, maxtime=0, fade_ms=0) -> Channel` - - Begin playback of the Sound (i.e., on the computer's speakers) on an - available Channel. This will forcibly select a Channel, so playback may - cut off a currently playing sound if necessary. - - The loops argument controls how many times the sample will be repeated - after being played the first time. A value of 5 means that the sound will - be played once, then repeated five times, and so is played a total of six - times. The default value (zero) means the Sound is not repeated, and so - is only played once. If loops is set to -1 the Sound will loop - indefinitely (though you can still call ``stop()`` to stop it). - - The maxtime argument can be used to stop playback after a given number of - milliseconds. - - The fade_ms argument will make the sound start playing at 0 volume and - fade up to full volume over the time given. The sample may end before the - fade-in is complete. - - This returns the Channel object for the channel that was selected. - - .. ## Sound.play ## - - .. method:: stop - - | :sl:`stop sound playback` - | :sg:`stop() -> None` - - This will stop the playback of this Sound on any active Channels. - - .. ## Sound.stop ## - - .. method:: fadeout - - | :sl:`stop sound playback after fading out` - | :sg:`fadeout(time) -> None` - - This will stop playback of the sound after fading it out over the time - argument in milliseconds. The Sound will fade and stop on all actively - playing channels. - - .. ## Sound.fadeout ## - - .. method:: set_volume - - | :sl:`set the playback volume for this Sound` - | :sg:`set_volume(value) -> None` - - This will set the playback volume (loudness) for this Sound. This will - immediately affect the Sound if it is playing. It will also affect any - future playback of this Sound. The argument is a value from 0.0 to 1.0. - - .. ## Sound.set_volume ## - - .. method:: get_volume - - | :sl:`get the playback volume` - | :sg:`get_volume() -> value` - - Return a value from 0.0 to 1.0 representing the volume for this Sound. - - .. ## Sound.get_volume ## - - .. method:: get_num_channels - - | :sl:`count how many times this Sound is playing` - | :sg:`get_num_channels() -> count` - - Return the number of active channels this sound is playing on. - - .. ## Sound.get_num_channels ## - - .. method:: get_length - - | :sl:`get the length of the Sound` - | :sg:`get_length() -> seconds` - - Return the length of this Sound in seconds. - - .. ## Sound.get_length ## - - .. method:: get_buffer - - | :sl:`acquires a buffer object for the samples of the Sound.` - | :sg:`get_buffer() -> BufferProxy` - - Return a buffer object for the Sound samples. The buffer can be used for - direct access and manipulation. - - New in pygame 1.8. - - .. ## Sound.get_buffer ## - - .. ## pygame.mixer.Sound ## - -.. class:: Channel - - | :sl:`Create a Channel object for controlling playback` - | :sg:`Channel(id) -> Channel` - - Return a Channel object for one of the current channels. The id must be a - value from 0 to the value of ``pygame.mixer.get_num_channels()``. - - The Channel object can be used to get fine control over the playback of - Sounds. A channel can only playback a single Sound at time. Using channels - is entirely optional since pygame can manage them by default. - - .. method:: play - - | :sl:`play a Sound on a specific Channel` - | :sg:`play(Sound, loops=0, maxtime=0, fade_ms=0) -> None` - - This will begin playback of a Sound on a specific Channel. If the Channel - is currently playing any other Sound it will be stopped. - - The loops argument has the same meaning as in ``Sound.play()``: it is the - number of times to repeat the sound after the first time. If it is 3, the - sound will be played 4 times (the first time, then three more). If loops - is -1 then the playback will repeat indefinitely. - - As in ``Sound.play()``, the maxtime argument can be used to stop playback - of the Sound after a given number of milliseconds. - - As in ``Sound.play()``, the fade_ms argument can be used fade in the - sound. - - .. ## Channel.play ## - - .. method:: stop - - | :sl:`stop playback on a Channel` - | :sg:`stop() -> None` - - Stop sound playback on a channel. After playback is stopped the channel - becomes available for new Sounds to play on it. - - .. ## Channel.stop ## - - .. method:: pause - - | :sl:`temporarily stop playback of a channel` - | :sg:`pause() -> None` - - Temporarily stop the playback of sound on a channel. It can be resumed at - a later time with ``Channel.unpause()`` - - .. ## Channel.pause ## - - .. method:: unpause - - | :sl:`resume pause playback of a channel` - | :sg:`unpause() -> None` - - Resume the playback on a paused channel. - - .. ## Channel.unpause ## - - .. method:: fadeout - - | :sl:`stop playback after fading channel out` - | :sg:`fadeout(time) -> None` - - Stop playback of a channel after fading out the sound over the given time - argument in milliseconds. - - .. ## Channel.fadeout ## - - .. method:: set_volume - - | :sl:`set the volume of a playing channel` - | :sg:`set_volume(value) -> None` - | :sg:`set_volume(left, right) -> None` - - Set the volume (loudness) of a playing sound. When a channel starts to - play its volume value is reset. This only affects the current sound. The - value argument is between 0.0 and 1.0. - - If one argument is passed, it will be the volume of both speakers. If two - arguments are passed and the mixer is in stereo mode, the first argument - will be the volume of the left speaker and the second will be the volume - of the right speaker. (If the second argument is None, the first argument - will be the volume of both speakers.) - - If the channel is playing a Sound on which ``set_volume()`` has also been - called, both calls are taken into account. For example: - - :: - - sound = pygame.mixer.Sound("s.wav") - channel = s.play() # Sound plays at full volume by default - sound.set_volume(0.9) # Now plays at 90% of full volume. - sound.set_volume(0.6) # Now plays at 60% (previous value replaced). - channel.set_volume(0.5) # Now plays at 30% (0.6 * 0.5). - - .. ## Channel.set_volume ## - - .. method:: get_volume - - | :sl:`get the volume of the playing channel` - | :sg:`get_volume() -> value` - - Return the volume of the channel for the current playing sound. This does - not take into account stereo separation used by - :meth:`Channel.set_volume`. The Sound object also has its own volume - which is mixed with the channel. - - .. ## Channel.get_volume ## - - .. method:: get_busy - - | :sl:`check if the channel is active` - | :sg:`get_busy() -> bool` - - Returns true if the channel is activily mixing sound. If the channel is - idle this returns False. - - .. ## Channel.get_busy ## - - .. method:: get_sound - - | :sl:`get the currently playing Sound` - | :sg:`get_sound() -> Sound` - - Return the actual Sound object currently playing on this channel. If the - channel is idle None is returned. - - .. ## Channel.get_sound ## - - .. method:: queue - - | :sl:`queue a Sound object to follow the current` - | :sg:`queue(Sound) -> None` - - When a Sound is queued on a Channel, it will begin playing immediately - after the current Sound is finished. Each channel can only have a single - Sound queued at a time. The queued Sound will only play if the current - playback finished automatically. It is cleared on any other call to - ``Channel.stop()`` or ``Channel.play()``. - - If there is no sound actively playing on the Channel then the Sound will - begin playing immediately. - - .. ## Channel.queue ## - - .. method:: get_queue - - | :sl:`return any Sound that is queued` - | :sg:`get_queue() -> Sound` - - If a Sound is already queued on this channel it will be returned. Once - the queued sound begins playback it will no longer be on the queue. - - .. ## Channel.get_queue ## - - .. method:: set_endevent - - | :sl:`have the channel send an event when playback stops` - | :sg:`set_endevent() -> None` - | :sg:`set_endevent(type) -> None` - - When an endevent is set for a channel, it will send an event to the - pygame queue every time a sound finishes playing on that channel (not - just the first time). Use ``pygame.event.get()`` to retrieve the endevent - once it's sent. - - Note that if you called ``Sound.play(n)`` or ``Channel.play(sound,n)``, - the end event is sent only once: after the sound has been played "n+1" - times (see the documentation of Sound.play). - - If ``Channel.stop()`` or ``Channel.play()`` is called while the sound was - still playing, the event will be posted immediately. - - The type argument will be the event id sent to the queue. This can be any - valid event type, but a good choice would be a value between - ``pygame.locals.USEREVENT`` and ``pygame.locals.NUMEVENTS``. If no type - argument is given then the Channel will stop sending endevents. - - .. ## Channel.set_endevent ## - - .. method:: get_endevent - - | :sl:`get the event a channel sends when playback stops` - | :sg:`get_endevent() -> type` - - Returns the event type to be sent every time the Channel finishes - playback of a Sound. If there is no endevent the function returns - ``pygame.NOEVENT``. - - .. ## Channel.get_endevent ## - - .. ## pygame.mixer.Channel ## - -.. ## pygame.mixer ##
--- a/docs/_sources/ref/mouse.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.mouse` -=================== - -.. module:: pygame.mouse - :synopsis: pygame module to work with the mouse - -| :sl:`pygame module to work with the mouse` - -The mouse functions can be used to get the current state of the mouse device. -These functions can also alter the system cursor for the mouse. - -When the display mode is set, the event queue will start receiving mouse -events. The mouse buttons generate ``pygame.MOUSEBUTTONDOWN`` and -``pygame.MOUSEBUTTONUP`` events when they are pressed and released. These -events contain a button attribute representing which button was pressed. The -mouse wheel will generate ``pygame.MOUSEBUTTONDOWN`` and -``pygame.MOUSEBUTTONUP`` events when rolled. The button will be set to 4 -when the wheel is rolled up, and to button 5 when the wheel is rolled down. -Anytime the mouse is moved it generates a ``pygame.MOUSEMOTION`` event. The -mouse movement is broken into small and accurate motion events. As the mouse -is moving many motion events will be placed on the queue. Mouse motion events -that are not properly cleaned from the event queue are the primary reason the -event queue fills up. - -If the mouse cursor is hidden, and input is grabbed to the current display the -mouse will enter a virtual input mode, where the relative movements of the -mouse will never be stopped by the borders of the screen. See the functions -``pygame.mouse.set_visible()`` and ``pygame.event.set_grab()`` to get this -configured. - -.. function:: get_pressed - - | :sl:`get the state of the mouse buttons` - | :sg:`get_pressed() -> (button1, button2, button3)` - - Returns a sequence of booleans representing the state of all the mouse - buttons. A true value means the mouse is currently being pressed at the time - of the call. - - Note, to get all of the mouse events it is better to use either - - :: - - pygame.event.wait() or pygame.event.get() and check all of those events - - to see if they are ``MOUSEBUTTONDOWN``, ``MOUSEBUTTONUP``, or - ``MOUSEMOTION``. - - Note, that on ``X11`` some XServers use middle button emulation. When you - click both buttons 1 and 3 at the same time a 2 button event can be emitted. - - Note, remember to call ``pygame.event.get()`` before this function. - Otherwise it will not work. - - .. ## pygame.mouse.get_pressed ## - -.. function:: get_pos - - | :sl:`get the mouse cursor position` - | :sg:`get_pos() -> (x, y)` - - Returns the ``X`` and ``Y`` position of the mouse cursor. The position is - relative the the top-left corner of the display. The cursor position can be - located outside of the display window, but is always constrained to the - screen. - - .. ## pygame.mouse.get_pos ## - -.. function:: get_rel - - | :sl:`get the amount of mouse movement` - | :sg:`get_rel() -> (x, y)` - - Returns the amount of movement in ``X`` and ``Y`` since the previous call to - this function. The relative movement of the mouse cursor is constrained to - the edges of the screen, but see the virtual input mouse mode for a way - around this. Virtual input mode is described at the top of the page. - - .. ## pygame.mouse.get_rel ## - -.. function:: set_pos - - | :sl:`set the mouse cursor position` - | :sg:`set_pos([x, y]) -> None` - - Set the current mouse position to arguments given. If the mouse cursor is - visible it will jump to the new coordinates. Moving the mouse will generate - a new ``pygame.MOUSEMOTION`` event. - - .. ## pygame.mouse.set_pos ## - -.. function:: set_visible - - | :sl:`hide or show the mouse cursor` - | :sg:`set_visible(bool) -> bool` - - If the bool argument is true, the mouse cursor will be visible. This will - return the previous visible state of the cursor. - - .. ## pygame.mouse.set_visible ## - -.. function:: get_focused - - | :sl:`check if the display is receiving mouse input` - | :sg:`get_focused() -> bool` - - Returns true when pygame is receiving mouse input events (or, in windowing - terminology, is "active" or has the "focus"). - - This method is most useful when working in a window. By contrast, in - full-screen mode, this method always returns true. - - Note: under ``MS`` Windows, the window that has the mouse focus also has the - keyboard focus. But under X-Windows, one window can receive mouse events and - another receive keyboard events. ``pygame.mouse.get_focused()`` indicates - whether the pygame window receives mouse events. - - .. ## pygame.mouse.get_focused ## - -.. function:: set_cursor - - | :sl:`set the image for the system mouse cursor` - | :sg:`set_cursor(size, hotspot, xormasks, andmasks) -> None` - - When the mouse cursor is visible, it will be displayed as a black and white - bitmap using the given bitmask arrays. The size is a sequence containing the - cursor width and height. Hotspot is a sequence containing the cursor hotspot - position. xormasks is a sequence of bytes containing the cursor xor data - masks. Lastly is andmasks, a sequence of bytes containting the cursor - bitmask data. - - Width must be a multiple of 8, and the mask arrays must be the correct size - for the given width and height. Otherwise an exception is raised. - - See the ``pygame.cursor`` module for help creating default and custom masks - for the system cursor. - - .. ## pygame.mouse.set_cursor ## - -.. function:: get_cursor - - | :sl:`get the image for the system mouse cursor` - | :sg:`get_cursor() -> (size, hotspot, xormasks, andmasks)` - - Get the information about the mouse system cursor. The return value is the - same data as the arguments passed into ``pygame.mouse.set_cursor()``. - - .. ## pygame.mouse.get_cursor ## - -.. ## pygame.mouse ##
--- a/docs/_sources/ref/movie.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,211 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.movie` -=================== - -.. module:: pygame.movie - :synopsis: pygame module for playback of mpeg video - -| :sl:`pygame module for playback of mpeg video` - -``NOTE``: On ``NT`` derived Windows versions (e.g. ``XT``) the default ``SDL`` -directx video driver is problematic. For :mod:`pygame.movie`, use the windib -driver instead. To enable windib set the ``SDL_VIDEODRIVER`` environment -variable to 'windib' before importing pygame (see the -:func:`pygame.examples.movieplayer.main` example). - -Pygame can playback video and audio from basic encoded MPEG-1 video files. -Movie playback happens in background threads, which makes playback easy to -manage. - -The audio for Movies must have full control over the sound system. This means -the :mod:`pygame.mixer` module must be uninitialized if the movie's sound is to -be played. The common solution is to call ``pygame.mixer.quit()`` before the -movie begins. The mixer can be reinitialized after the movie is finished. - -The video overlay planes are drawn on top of everything in the display window. -To draw the movie as normal graphics into the display window, create an -offscreen Surface and set that as the movie target. Then once per frame blit -that surface to the screen. - -Videos can be converted to the .mpg file format (MPEG-1 video, MPEG-1 Audio -Layer ``III`` (MP3) sound) using ffmpeg video conversion program -(http://ffmpeg.org/): - -:: - - ffmpeg -i <infile> -vcodec mpeg1video -acodec libmp3lame -intra <outfile.mpg> - -.. class:: Movie - - | :sl:`load an mpeg movie file` - | :sg:`Movie(filename) -> Movie` - | :sg:`Movie(object) -> Movie` - - Load a new ``MPEG`` movie stream from a file or a python file object. The - Movie object operates similar to the Sound objects from :mod:`pygame.mixer`. - - Movie objects have a target display Surface. The movie is rendered into this - Surface in a background thread. If the target Surface is the display - Surface, the movie will try to use the hardware accelerated video overlay. - The default target is the display Surface. - - .. method:: play - - | :sl:`start playback of a movie` - | :sg:`play(loops=0) -> None` - - Starts playback of the movie. Sound and video will begin playing if they - are not disabled. The optional loops argument controls how many times the - movie will be repeated. A loop value of -1 means the movie will repeat - forever. - - .. ## Movie.play ## - - .. method:: stop - - | :sl:`stop movie playback` - | :sg:`stop() -> None` - - Stops the playback of a movie. The video and audio playback will be - stopped at their current position. - - .. ## Movie.stop ## - - .. method:: pause - - | :sl:`temporarily stop and resume playback` - | :sg:`pause() -> None` - - This will temporarily stop or restart movie playback. - - .. ## Movie.pause ## - - .. method:: skip - - | :sl:`advance the movie playback position` - | :sg:`skip(seconds) -> None` - - Advance the movie playback time in seconds. This can be called before the - movie is played to set the starting playback time. This can only skip the - movie forward, not backwards. The argument is a floating point number. - - .. ## Movie.skip ## - - .. method:: rewind - - | :sl:`restart the movie playback` - | :sg:`rewind() -> None` - - Sets the movie playback position to the start of the movie. The movie - will automatically begin playing even if it stopped. - - The can raise a ValueError if the movie cannot be rewound. If the rewind - fails the movie object is considered invalid. - - .. ## Movie.rewind ## - - .. method:: render_frame - - | :sl:`set the current video frame` - | :sg:`render_frame(frame_number) -> frame_number` - - This takes an integer frame number to render. It attempts to render the - given frame from the movie to the target Surface. It returns the real - frame number that got rendered. - - .. ## Movie.render_frame ## - - .. method:: get_frame - - | :sl:`get the current video frame` - | :sg:`get_frame() -> frame_number` - - Returns the integer frame number of the current video frame. - - .. ## Movie.get_frame ## - - .. method:: get_time - - | :sl:`get the current vide playback time` - | :sg:`get_time() -> seconds` - - Return the current playback time as a floating point value in seconds. - This method currently seems broken and always returns 0.0. - - .. ## Movie.get_time ## - - .. method:: get_busy - - | :sl:`check if the movie is currently playing` - | :sg:`get_busy() -> bool` - - Returns true if the movie is currently being played. - - .. ## Movie.get_busy ## - - .. method:: get_length - - | :sl:`the total length of the movie in seconds` - | :sg:`get_length() -> seconds` - - Returns the length of the movie in seconds as a floating point value. - - .. ## Movie.get_length ## - - .. method:: get_size - - | :sl:`get the resolution of the video` - | :sg:`get_size() -> (width, height)` - - Gets the resolution of the movie video. The movie will be stretched to - the size of any Surface, but this will report the natural video size. - - .. ## Movie.get_size ## - - .. method:: has_video - - | :sl:`check if the movie file contains video` - | :sg:`has_video() -> bool` - - True when the opened movie file contains a video stream. - - .. ## Movie.has_video ## - - .. method:: has_audio - - | :sl:`check if the movie file contains audio` - | :sg:`has_audio() -> bool` - - True when the opened movie file contains an audio stream. - - .. ## Movie.has_audio ## - - .. method:: set_volume - - | :sl:`set the audio playback volume` - | :sg:`set_volume(value) -> None` - - Set the playback volume for this movie. The argument is a value between - 0.0 and 1.0. If the volume is set to 0 the movie audio will not be - decoded. - - .. ## Movie.set_volume ## - - .. method:: set_display - - | :sl:`set the video target Surface` - | :sg:`set_display(Surface, rect=None) -> None` - - Set the output target Surface for the movie video. You may also pass a - rectangle argument for the position, which will move and stretch the - video into the given area. - - If None is passed as the target Surface, the video decoding will be - disabled. - - .. ## Movie.set_display ## - - .. ## pygame.movie.Movie ## - -.. ## pygame.movie ##
--- a/docs/_sources/ref/music.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.mixer.music` -========================= - -.. module:: pygame.mixer.music - :synopsis: pygame module for controlling streamed audio - -| :sl:`pygame module for controlling streamed audio` - -The music module is closely tied to :mod:`pygame.mixer`. Use the music module -to control the playback of music in the sound mixer. - -The difference between the music playback and regular Sound playback is that -the music is streamed, and never actually loaded all at once. The mixer system -only supports a single music stream at once. - -Be aware that ``MP3`` support is limited. On some systems an unsupported format -can crash the program, ``e.g``. Debian Linux. Consider using ``OGG`` instead. - -.. function:: load - - | :sl:`Load a music file for playback` - | :sg:`load(filename) -> None` - | :sg:`load(object) -> None` - - This will load a music filename/file object and prepare it for playback. If - a music stream is already playing it will be stopped. This does not start - the music playing. - - .. ## pygame.mixer.music.load ## - -.. function:: play - - | :sl:`Start the playback of the music stream` - | :sg:`play(loops=0, start=0.0) -> None` - - This will play the loaded music stream. If the music is already playing it - will be restarted. - - The loops argument controls the number of repeats a music will play. - ``play(5)`` will cause the music to played once, then repeated five times, - for a total of six. If the loops is -1 then the music will repeat - indefinitely. - - The starting position argument controls where in the music the song starts - playing. The starting position is dependent on the format of music playing. - ``MP3`` and ``OGG`` use the position as time (in seconds). ``MOD`` music it - is the pattern order number. Passing a startpos will raise a - NotImplementedError if it cannot set the start position - - .. ## pygame.mixer.music.play ## - -.. function:: rewind - - | :sl:`restart music` - | :sg:`rewind() -> None` - - Resets playback of the current music to the beginning. - - .. ## pygame.mixer.music.rewind ## - -.. function:: stop - - | :sl:`stop the music playback` - | :sg:`stop() -> None` - - Stops the music playback if it is currently playing. - - .. ## pygame.mixer.music.stop ## - -.. function:: pause - - | :sl:`temporarily stop music playback` - | :sg:`pause() -> None` - - Temporarily stop playback of the music stream. It can be resumed with the - ``pygame.mixer.music.unpause()`` function. - - .. ## pygame.mixer.music.pause ## - -.. function:: unpause - - | :sl:`resume paused music` - | :sg:`unpause() -> None` - - This will resume the playback of a music stream after it has been paused. - - .. ## pygame.mixer.music.unpause ## - -.. function:: fadeout - - | :sl:`stop music playback after fading out` - | :sg:`fadeout(time) -> None` - - This will stop the music playback after it has been faded out over the - specified time (measured in milliseconds). - - Note, that this function blocks until the music has faded out. - - .. ## pygame.mixer.music.fadeout ## - -.. function:: set_volume - - | :sl:`set the music volume` - | :sg:`set_volume(value) -> None` - - Set the volume of the music playback. The value argument is between 0.0 and - 1.0. When new music is loaded the volume is reset. - - .. ## pygame.mixer.music.set_volume ## - -.. function:: get_volume - - | :sl:`get the music volume` - | :sg:`get_volume() -> value` - - Returns the current volume for the mixer. The value will be between 0.0 and - 1.0. - - .. ## pygame.mixer.music.get_volume ## - -.. function:: get_busy - - | :sl:`check if the music stream is playing` - | :sg:`get_busy() -> bool` - - Returns True when the music stream is actively playing. When the music is - idle this returns False. - - .. ## pygame.mixer.music.get_busy ## - -.. function:: set_pos - - | :sl:`set position to play from` - | :sg:`set_pos(pos) -> None` - - This sets the position in the music file where playback will start. The - meaning of "pos", a float (or a number that can be converted to a float), - depends on the music format. Newer versions of SDL_mixer have better - positioning support than earlier. An SDLError is raised if a particular - format does not support positioning. - - .. ## pygame.mixer.music.set_pos ## - -.. function:: get_pos - - | :sl:`get the music play time` - | :sg:`get_pos() -> time` - - This gets the number of milliseconds that the music has been playing for. - The returned time only represents how long the music has been playing; it - does not take into account any starting position offsets. - - .. ## pygame.mixer.music.get_pos ## - -.. function:: queue - - | :sl:`queue a music file to follow the current` - | :sg:`queue(filename) -> None` - - This will load a music file and queue it. A queued music file will begin as - soon as the current music naturally ends. If the current music is ever - stopped or changed, the queued song will be lost. - - The following example will play music by Bach six times, then play music by - Mozart once: - - :: - - pygame.mixer.music.load('bach.ogg') - pygame.mixer.music.play(5) # Plays six times, not five! - pygame.mixer.music.queue('mozart.ogg') - - .. ## pygame.mixer.music.queue ## - -.. function:: set_endevent - - | :sl:`have the music send an event when playback stops` - | :sg:`set_endevent() -> None` - | :sg:`set_endevent(type) -> None` - - This causes Pygame to signal (by means of the event queue) when the music is - done playing. The argument determines the type of event that will be queued. - - The event will be queued every time the music finishes, not just the first - time. To stop the event from being queued, call this method with no - argument. - - .. ## pygame.mixer.music.set_endevent ## - -.. function:: get_endevent - - | :sl:`get the event a channel sends when playback stops` - | :sg:`get_endevent() -> type` - - Returns the event type to be sent every time the music finishes playback. If - there is no endevent the function returns ``pygame.NOEVENT``. - - .. ## pygame.mixer.music.get_endevent ## - -.. ## pygame.mixer.music ##
--- a/docs/_sources/ref/overlay.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.Overlay` -===================== - -.. currentmodule:: pygame - -.. class:: Overlay - - | :sl:`pygame object for video overlay graphics` - | :sg:`Overlay(format, (width, height)) -> Overlay` - - The Overlay objects provide support for accessing hardware video overlays. - Video overlays do not use standard ``RGB`` pixel formats, and can use - multiple resolutions of data to create a single image. - - The Overlay objects represent lower level access to the display hardware. To - use the object you must understand the technical details of video overlays. - - The Overlay format determines the type of pixel data used. Not all hardware - will support all types of overlay formats. Here is a list of available - format types: - - :: - - YV12_OVERLAY, IYUV_OVERLAY, YUV2_OVERLAY, UYVY_OVERLAY, YVYU_OVERLAY - - The width and height arguments control the size for the overlay image data. - The overlay image can be displayed at any size, not just the resolution of - the overlay. - - The overlay objects are always visible, and always show above the regular - display contents. - - .. method:: display - - | :sl:`set the overlay pixel data` - | :sg:`display((y, u, v)) -> None` - | :sg:`display() -> None` - - Display the yuv data in SDL's overlay planes. The y, u, and v arguments - are strings of binary data. The data must be in the correct format used - to create the Overlay. - - If no argument is passed in, the Overlay will simply be redrawn with the - current data. This can be useful when the Overlay is not really hardware - accelerated. - - The strings are not validated, and improperly sized strings could crash - the program. - - .. ## Overlay.display ## - - .. method:: set_location - - | :sl:`control where the overlay is displayed` - | :sg:`set_location(rect) -> None` - - Set the location for the overlay. The overlay will always be shown - relative to the main display Surface. This does not actually redraw the - overlay, it will be updated on the next call to ``Overlay.display()``. - - .. ## Overlay.set_location ## - - .. method:: get_hardware - - | :sl:`test if the Overlay is hardware accelerated` - | :sg:`get_hardware(rect) -> int` - - Returns a True value when the Overlay is hardware accelerated. If the - platform does not support acceleration, software rendering is used. - - .. ## Overlay.get_hardware ## - - .. ## pygame.Overlay ##
--- a/docs/_sources/ref/pixelarray.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -.. include:: common.txt - -:class:`pygame.PixelArray` -========================== - -.. currentmodule:: pygame - -.. class:: PixelArray - - | :sl:`pygame object for direct pixel access of surfaces` - | :sg:`PixelArray(Surface) -> PixelArray` - - The PixelArray wraps a Surface and provides direct access to the - surface's pixels. A pixel array can be one or two dimensional. - A two dimensional array, like its surface, is indexed [column, row]. - Pixel arrays support slicing, both for returning a subarray or - for assignment. A pixel array sliced on a single column or row - returns a one dimensional pixel array. Arithmetic and other operations - are not supported. A pixel array can be safely assigned to itself. - Finally, pixel arrays export an array struct interface, allowing - them to interact with :mod:`pygame.pixelcopy` methods and NumPy - arrays. - - A PixelArray pixel item can be assigned a raw integer values, a - :class:`pygame.Color` instance, or a (r, g, b[, a]) tuple. - - :: - - pxarray[x, y] = 0xFF00FF - pxarray[x, y] = pygame.Color(255, 0, 255) - pxarray[x, y] = (255, 0, 255) - - However, only a pixel's integer value is returned. So, to compare a pixel - to a particular color the color needs to be first mapped using - the :meth:`Surface.map_rgb()` method of the Surface object for which the - PixelArray was created. - - :: - - pxarray = pygame.PixelArray(surface) - # Check, if the first pixel at the topleft corner is blue - if pxarray[0, 0] == surface.map_rgb((0, 0, 255)): - ... - - When assigning to a range of of pixels, a non tuple sequence of colors or - a PixelArray can be used as the value. For a sequence, the length must - match the PixelArray width. - - :: - - pxarray[a:b] = 0xFF00FF # set all pixels to 0xFF00FF - pxarray[a:b] = (0xFF00FF, 0xAACCEE, ... ) # first pixel = 0xFF00FF, - # second pixel = 0xAACCEE, ... - pxarray[a:b] = [(255, 0, 255), (170, 204, 238), ...] # same as above - pxarray[a:b] = [(255, 0, 255), 0xAACCEE, ...] # same as above - pxarray[a:b] = otherarray[x:y] # slice sizes must match - - For PixelArray assignment, if the right hand side array has a row length - of 1, then the column is broadcast over the target array's rows. An - array of height 1 is broadcast over the target's columns, and is equivalent - to assigning a 1D PixelArray. - - Subscipt slices can also be used to assign to a rectangular subview of - the target PixelArray. - - :: - - # Create some new PixelArray objects providing a different view - # of the original array/surface. - newarray = pxarray[2:4, 3:5] - otherarray = pxarray[::2, ::2] - - Subscript slices can also be used to do fast rectangular pixel manipulations - instead of iterating over the x or y axis. The - - :: - - pxarray[::2, :] = (0, 0, 0) # Make even columns black. - pxarray[::2] = (0, 0, 0) # Same as [::2, :] - - During its lifetime, the PixelArray locks the surface, thus you explicitly - have to delete it once its not used anymore and the surface should perform - operations in the same scope. A simple ``:`` slice index for the column can - be omitted. - - :: - - pxarray[::2, ...] = (0, 0, 0) # Same as pxarray[::2, :] - pxarray[...] = (255, 0, 0) # Same as pxarray[:] - - A note about PixelArray to PixelArray assignment, for arrays with an - item size of 3 (created from 24 bit surfaces) pixel values are translated - from the source to the destinations format. The red, green, and blue - color elements of each pixel are shifted to match the format of the - target surface. For all other pixel sizes no such remapping occurs. - This should change in later Pygame releases, where format conversions - are performed for all pixel sizes. To avoid code breakage when full mapped - copying is implemented it is suggested PixelArray to PixelArray copies be - only between surfaces of identical format. - - New in pygame 1.9.2 - - - array struct interface - - transpose method - - broadcasting for a length 1 dimension - - Changed in pyame 1.9.2 - - - A 2D PixelArray can have a length 1 dimension. - Only an integer index on a 2D PixelArray returns a 1D array. - - For assignment, a tuple can only be a color. Any other sequence type - is a sequence of colors. - - - .. versionadded: 1.8.0 - Subscript support - - .. versionadded: 1.8.1 - Methods :meth:`make_surface`, :meth:`replace`, :meth:`extract`, and - :meth:`compare` - - .. versionadded: 1.9.2 - Properties :attr:`itemsize`, :attr:`ndim`, :attr:`shape`, - and :attr:`strides` - - .. versionadded: 1.9.2 - Array struct interface - - - .. attribute:: surface - - | :sl:`Gets the Surface the PixelArray uses.` - | :sg:`surface -> Surface` - - The Surface the PixelArray was created for. - - .. ## PixelArray.surface ## - - .. attribute:: itemsize - - | :sl:`Returns the byte size of a pixel array item` - | :sg:`itemsize -> int` - - This is the same as :meth:`Surface.get_bytesize` for the - pixel array's surface. - - New in pygame 1.9.2 - - .. attribute:: ndim - - | :sl:`Returns the number of dimensions.` - | :sg:`ndim -> int` - - A pixel array can be 1 or 2 dimensional. - - New in pygame 1.9.2 - - .. attribute:: shape - - | :sl:`Returns the array size.` - | :sg:`shape -> tuple of int's` - - A tuple or length :attr:`ndim` giving the length of each - dimension. Analogous to :meth:`Surface.get_size`. - - New in pygame 1.9.2 - - .. attribute:: strides - - | :sl:`Returns byte offsets for each array dimension.` - | :sg:`strides -> tuple of int's` - - A tuple or length :attr:`ndim` byte counts. When a stride is - multiplied by the corresponding index it gives the offset - of that index from the start of the array. A stride is negative - for an array that has is inverted (has a negative step). - - New in pygame 1.9.2 - - .. method:: make_surface - - | :sl:`Creates a new Surface from the current PixelArray.` - | :sg:`make_surface() -> Surface` - - Creates a new Surface from the current PixelArray. Depending on the - current PixelArray the size, pixel order etc. will be different from the - original Surface. - - :: - - # Create a new surface flipped around the vertical axis. - sf = pxarray[:,::-1].make_surface () - - New in pygame 1.8.1. - - .. ## PixelArray.make_surface ## - - .. method:: replace - - | :sl:`Replaces the passed color in the PixelArray with another one.` - | :sg:`replace(color, repcolor, distance=0, weights=(0.299, 0.587, 0.114)) -> None` - - Replaces the pixels with the passed color in the PixelArray by changing - them them to the passed replacement color. - - It uses a simple weighted euclidian distance formula to calculate the - distance between the colors. The distance space ranges from 0.0 to 1.0 - and is used as threshold for the color detection. This causes the - replacement to take pixels with a similar, but not exactly identical - color, into account as well. - - This is an in place operation that directly affects the pixels of the - PixelArray. - - New in pygame 1.8.1. - - .. ## PixelArray.replace ## - - .. method:: extract - - | :sl:`Extracts the passed color from the PixelArray.` - | :sg:`extract(color, distance=0, weights=(0.299, 0.587, 0.114)) -> PixelArray` - - Extracts the passed color by changing all matching pixels to white, while - non-matching pixels are changed to black. This returns a new PixelArray - with the black/white color mask. - - It uses a simple weighted euclidian distance formula to calculate the - distance between the colors. The distance space ranges from 0.0 to 1.0 - and is used as threshold for the color detection. This causes the - extraction to take pixels with a similar, but not exactly identical - color, into account as well. - - New in pygame 1.8.1. - - .. ## PixelArray.extract ## - - .. method:: compare - - | :sl:`Compares the PixelArray with another one.` - | :sg:`compare(array, distance=0, weights=(0.299, 0.587, 0.114)) -> PixelArray` - - Compares the contents of the PixelArray with those from the passed - PixelArray. It returns a new PixelArray with a black/white color mask - that indicates the differences (white) of both arrays. Both PixelArray - objects must have indentical bit depths and dimensions. - - It uses a simple weighted euclidian distance formula to calculate the - distance between the colors. The distance space ranges from 0.0 to 1.0 - and is used as threshold for the color detection. This causes the - comparision to mark pixels with a similar, but not exactly identical - color, as black. - - New in pygame 1.8.1. - - .. ## PixelArray.compare ## - - .. method:: transpose - - | :sl:`Exchanges the x and y axis.` - | :sg:`transpose() -> PixelArray` - - This method returns a new view of the pixel array with the rows and - columns swapped. So for a (w, h) sized array a (h, w) slice is returned. - If an array is one dimensional, then a length 1 x dimension is added, - resulting in a 2D pixel array. - - New in pygame 1.9.2 - - .. ## PixelArray.transpose ## - - .. ## pygame.PixelArray ##
--- a/docs/_sources/ref/pixelcopy.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.pixelcopy` -======================= - -.. module:: pygame.pixelcopy - :synopsis: pygame module for general pixel array copying - -| :sl:`pygame module for general pixel array copying` - -EXPERIMENTAL, though any future changes are likely to be backward-compatible. - -The :mod:`pygame.pixelcopy` module contains methods for copying between -surfaces and objects exporting an array structure interface. It is a backend -for :mod:`pygame.surfarray`, adding NumPy support. But pixelcopy is more, -general, and intended for direct use (see the -:func:`pygame.examples.pixelcopy.main` example. - -The array struct interface exposes an array's data in a standard way. -It was introduced in NumPy. In Python 2.7 and above it is replaced by the -new buffer protocol, though the buffer protocol is still a work in progress. -The array struct interface, on the other hand, is stable and works with earlier -Python versions. So for now the array struct interface is the predominate way -Pygame handles array introspection. - -New in pygame 1.9.2. - -.. function:: surface_to_array - - | :sl:`copy surface pixels to an array object` - | :sg:`surface_to_array(array, surface, kind='P', opaque=255, clear=0) -> None` - - The surface_to_array function copies pixels from a Surface object - to a 2D or 3D array. Depending on argument ``kind`` and the target array - dimension, a copy may be raw pixel value, RGB, a color component slice, - or colorkey alpha transparency value. Recognized ``kind`` values are the - single character codes 'P', 'R', 'G', 'B', 'A', and 'C'. Kind codes are case - insensitive, so 'p' is equivalent to 'P'. The first two dimensions - of the target must be the surface size (w, h). - - The default 'P' kind code does a direct raw integer pixel (mapped) value - copy to a 2D array and a 'RGB' pixel component (unmapped) copy to a 3D array - having shape (w, h, 3). For an 8 bit colormap surface this means the - table index is copied to a 2D array, not the table value itself. A 2D - array's item size must be at least as large as the surface's pixel - byte size. The item size of a 3D array must be at least one byte. - - For the 'R', 'G', 'B', and 'A' copy kinds a single color component - of the unmapped surface pixels are copied to the target 2D array. - For kind 'A' and surfaces with source alpha (the surface was created with - the SRCALPHA flag), has a colorkey (set with :meth:`Surface.set_colorkey`), - or has a blanket alpha (set with :meth:`Surface.set_alpha`) then the - alpha values are those expected for a SDL surface. If a surface has - no explicit alpha value, then the target array is filled with the - value of the optional ``opaque`` surface_to_array argument (default - 255: not transparent). - - Copy kind 'C' is a special case for alpha copy of a source surface - with colorkey. Unlike the 'A' color component copy, the ``clear`` - argument value is used for colorkey matches, ``opaque`` otherwise. - By default, a match has alpha 0 (totally transparent), while everything - else is alpha 255 (totally opaque). It is a more general implementation - of :meth:`pygame.surfarray.array_colorkey`. - - Specific to surface_to_array, a ValueError is raised for target arrays - with incorrect shape or item size. A TypeError is raised for an incorrect - kind code. Surface specific problems, such as locking, raise a pygame.error. - - .. ## pygame.pixelcopy.surface_to_array ## - -.. function:: array_to_surface - - | :sl:`copy an array object to a surface` - | :sg:`array_to_surface(<surface>, <array>) -> None` - - See :func:`pygame.surfarray.blit_array`. - - .. ## pygame.pixelcopy.array_to_surface ## - -.. function:: map_array - - | :sl:`copy an array to another array, using surface format` - | :sg:`map_array(<array>, <array>, <surface>) -> None` - - Map an array of color element values - (w, h, ..., 3) - to an array of - pixels - (w, h) according to the format of <<urface>. - - .. ## pygame.pixelcopy.map_array ## - -.. function:: make_surface - - | :sl:`Copy an array to a new surface` - | :sg:`pygame.pixelcopy.make_surface(array) -> Surface` - - Create a new Surface that best resembles the data and format of the array. - The array can be 2D or 3D with any sized integer values. - - .. ## pygame.pixelcopy.make_surface ## - -.. ## pygame.pixelcopy ##
--- a/docs/_sources/ref/pygame.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -.. include:: common.txt - -:mod:`pygame` -============= - -.. module:: pygame - :synopsis: the top level pygame package - -| :sl:`the top level pygame package` - -The pygame package represents the top-level package for others to use. Pygame -itself is broken into many submodules, but this does not affect programs that -use Pygame. - -As a convenience, most of the top-level variables in pygame have been placed -inside a module named 'pygame.locals'. This is meant to be used with 'from -:mod:`pygame.locals` import \*', in addition to 'import pygame'. - -When you 'import pygame' all available pygame submodules are automatically -imported. Be aware that some of the pygame modules are considered "optional", -and may not be available. In that case, Pygame will provide a placeholder -object instead of the module, which can be used to test for availability. - -.. function:: init - - | :sl:`initialize all imported pygame modules` - | :sg:`init() -> (numpass, numfail)` - - Initialize all imported Pygame modules. No exceptions will be raised if a - module fails, but the total number if successful and failed inits will be - returned as a tuple. You can always initialize individual modules manually, - but :func:`pygame.init` is a convenient way to get everything started. The - ``init()`` functions for individual modules will raise exceptions when they - fail. - - You may want to initalise the different modules seperately to speed up your - program or to not use things your game does not. - - It is safe to call this ``init()`` more than once: repeated calls will have - no effect. This is true even if you have ``pygame.quit()`` all the modules. - - .. ## pygame.init ## - -.. function:: quit - - | :sl:`uninitialize all pygame modules` - | :sg:`quit() -> None` - - Uninitialize all pygame modules that have previously been initialized. When - the Python interpreter shuts down, this method is called regardless, so your - program should not need it, except when it wants to terminate its pygame - resources and continue. It is safe to call this function more than once: - repeated calls have no effect. - - Note, that :func:`pygame.quit` will not exit your program. Consider letting - your program end in the same way a normal python program will end. - - .. ## pygame.quit ## - -.. exception:: error - - | :sl:`standard pygame exception` - | :sg:`raise pygame.error(message)` - - This exception is raised whenever a pygame or ``SDL`` operation fails. You - can catch any anticipated problems and deal with the error. The exception is - always raised with a descriptive message about the problem. - - Derived from the RuntimeError exception, which can also be used to catch - these raised errors. - - .. ## pygame.error ## - -.. function:: get_error - - | :sl:`get the current error message` - | :sg:`get_error() -> errorstr` - - ``SDL`` maintains an internal error message. This message will usually be - given to you when :func:`pygame.error` is raised. You will rarely need to - call this function. - - .. ## pygame.get_error ## - -.. function:: set_error - - | :sl:`set the current error message` - | :sg:`set_error(error_msg) -> None` - - ``SDL`` maintains an internal error message. This message will usually be - given to you when :func:`pygame.error` is raised. You will rarely need to - call this function. - - .. ## pygame.set_error ## - -.. function:: get_sdl_version - - | :sl:`get the version number of SDL` - | :sg:`get_sdl_version() -> major, minor, patch` - - Returns the three version numbers of the ``SDL`` library. This version is - built at compile time. It can be used to detect which features may not be - available through Pygame. - - get_sdl_version is new in pygame 1.7.0 - - .. ## pygame.get_sdl_version ## - -.. function:: get_sdl_byteorder - - | :sl:`get the byte order of SDL` - | :sg:`get_sdl_byteorder() -> int` - - Returns the byte order of the ``SDL`` library. It returns ``LIL_ENDIAN`` for - little endian byte order and ``BIG_ENDIAN`` for big endian byte order. - - get_sdl_byteorder is new in pygame 1.8 - - .. ## pygame.get_sdl_byteorder ## - -.. function:: register_quit - - | :sl:`register a function to be called when pygame quits` - | :sg:`register_quit(callable) -> None` - - When :func:`pygame.quit` is called, all registered quit functions are - called. Pygame modules do this automatically when they are initializing. - This function is not be needed for regular pygame users. - - .. ## pygame.register_quit ## - -.. function:: encode_string - - | :sl:`Encode a unicode or bytes object` - | :sg:`encode_string([obj [, encoding [, errors [, etype]]]]) -> bytes or None` - - obj: If unicode, encode; if bytes, return unaltered; if anything else, - return None; if not given, raise SyntaxError. - - encoding (string): If present, encoding to use. The default is - 'unicode_escape'. - - errors (string): If given, how to handle unencodable characters. The default - is 'backslashreplace'. - - etype (exception type): If given, the exception type to raise for an - encoding error. The default is UnicodeEncodeError, as returned by - ``PyUnicode_AsEncodedString()``. For the default encoding and errors values - there should be no encoding errors. - - This function is used in encoding file paths. Keyword arguments are - supported. - - Added in Pygame 1.9.2 (primarily for use in unit tests) - - .. ## pygame.encode_string ## - -.. function:: encode_file_path - - | :sl:`Encode a unicode or bytes object as a file system path` - | :sg:`encode_file_path([obj [, etype]]) -> bytes or None` - - obj: If unicode, encode; if bytes, return unaltered; if anything else, - return None; if not given, raise SyntaxError. - - etype (exception type): If given, the exception type to raise for an - encoding error. The default is UnicodeEncodeError, as returned by - ``PyUnicode_AsEncodedString()``. - - This function is used to encode file paths in Pygame. Encoding is to the - codec as returned by ``sys.getfilesystemencoding()``. Keyword arguments are - supported. - - Added in Pygame 1.9.2 (primarily for use in unit tests) - - .. ## pygame.encode_file_path ## - -:mod:`pygame.version` -===================== - -.. module:: pygame.version - :synopsis: small module containing version information - -| :sl:`small module containing version information` - -This module is automatically imported into the pygame package and offers a few -variables to check with version of pygame has been imported. - -.. data:: ver - - | :sl:`version number as a string` - | :sg:`ver = '1.2'` - - This is the version represented as a string. It can contain a micro release - number as well, ``e.g.``, '1.5.2' - - .. ## pygame.version.ver ## - -.. data:: vernum - - | :sl:`tupled integers of the version` - | :sg:`vernum = (1, 5, 3)` - - This variable for the version can easily be compared with other version - numbers of the same format. An example of checking Pygame version numbers - would look like this: - - :: - - if pygame.version.vernum < (1, 5): - print 'Warning, older version of Pygame (%s)' % pygame.version.ver - disable_advanced_features = True - - .. ## pygame.version.vernum ## - -.. ## pygame.version ## - -.. ## pygame ##
--- a/docs/_sources/ref/rect.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,294 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.Rect` -================== - -.. currentmodule:: pygame - -.. class:: Rect - - | :sl:`pygame object for storing rectangular coordinates` - | :sg:`Rect(left, top, width, height) -> Rect` - | :sg:`Rect((left, top), (width, height)) -> Rect` - | :sg:`Rect(object) -> Rect` - - Pygame uses Rect objects to store and manipulate rectangular areas. A Rect - can be created from a combination of left, top, width, and height values. - Rects can also be created from python objects that are already a Rect or - have an attribute named "rect". - - Any Pygame function that requires a Rect argument also accepts any of these - values to construct a Rect. This makes it easier to create Rects on the fly - as arguments to functions. - - The Rect functions that change the position or size of a Rect return a new - copy of the Rect with the affected changes. The original Rect is not - modified. Some methods have an alternate "in-place" version that returns - None but effects the original Rect. These "in-place" methods are denoted - with the "ip" suffix. - - The Rect object has several virtual attributes which can be used to move and - align the Rect: - - :: - - top, left, bottom, right - topleft, bottomleft, topright, bottomright - midtop, midleft, midbottom, midright - center, centerx, centery - size, width, height - w,h - - All of these attributes can be assigned to: - - :: - - rect1.right = 10 - rect2.center = (20,30) - - Assigning to size, width or height changes the dimensions of the rectangle; - all other assignments move the rectangle without resizing it. Notice that - some attributes are integers and others are pairs of integers. - - If a Rect has a nonzero width or height, it will return True for a nonzero - test. Some methods return a Rect with 0 size to represent an invalid - rectangle. - - The coordinates for Rect objects are all integers. The size values can be - programmed to have negative values, but these are considered illegal Rects - for most operations. - - There are several collision tests between other rectangles. Most python - containers can be searched for collisions against a single Rect. - - The area covered by a Rect does not include the right- and bottom-most edge - of pixels. If one Rect's bottom border is another Rect's top border (i.e., - rect1.bottom=rect2.top), the two meet exactly on the screen but do not - overlap, and ``rect1.colliderect(rect2)`` returns false. - - Though Rect can be subclassed, methods that return new rectangles are not - subclass aware. That is, move or copy return a new :mod:`pygame.Rect` - instance, not an instance of the subclass. This may change. To make subclass - awareness work though, subclasses may have to maintain the same constructor - signature as Rect. - - .. method:: copy - - | :sl:`copy the rectangle` - | :sg:`copy() -> Rect` - - Returns a new rectangle having the same position and size as the orginal. - - New in pygame 1.9 - - .. ## Rect.copy ## - - .. method:: move - - | :sl:`moves the rectangle` - | :sg:`move(x, y) -> Rect` - - Returns a new rectangle that is moved by the given offset. The x and y - arguments can be any integer value, positive or negative. - - .. ## Rect.move ## - - .. method:: move_ip - - | :sl:`moves the rectangle, in place` - | :sg:`move_ip(x, y) -> None` - - Same as the ``Rect.move()`` method, but operates in place. - - .. ## Rect.move_ip ## - - .. method:: inflate - - | :sl:`grow or shrink the rectangle size` - | :sg:`inflate(x, y) -> Rect` - - Returns a new rectangle with the size changed by the given offset. The - rectangle remains centered around its current center. Negative values - will shrink the rectangle. - - .. ## Rect.inflate ## - - .. method:: inflate_ip - - | :sl:`grow or shrink the rectangle size, in place` - | :sg:`inflate_ip(x, y) -> None` - - Same as the ``Rect.inflate()`` method, but operates in place. - - .. ## Rect.inflate_ip ## - - .. method:: clamp - - | :sl:`moves the rectangle inside another` - | :sg:`clamp(Rect) -> Rect` - - Returns a new rectangle that is moved to be completely inside the - argument Rect. If the rectangle is too large to fit inside, it is - centered inside the argument Rect, but its size is not changed. - - .. ## Rect.clamp ## - - .. method:: clamp_ip - - | :sl:`moves the rectangle inside another, in place` - | :sg:`clamp_ip(Rect) -> None` - - Same as the ``Rect.clamp()`` method, but operates in place. - - .. ## Rect.clamp_ip ## - - .. method:: clip - - | :sl:`crops a rectangle inside another` - | :sg:`clip(Rect) -> Rect` - - Returns a new rectangle that is cropped to be completely inside the - argument Rect. If the two rectangles do not overlap to begin with, a Rect - with 0 size is returned. - - .. ## Rect.clip ## - - .. method:: union - - | :sl:`joins two rectangles into one` - | :sg:`union(Rect) -> Rect` - - Returns a new rectangle that completely covers the area of the two - provided rectangles. There may be area inside the new Rect that is not - covered by the originals. - - .. ## Rect.union ## - - .. method:: union_ip - - | :sl:`joins two rectangles into one, in place` - | :sg:`union_ip(Rect) -> None` - - Same as the ``Rect.union()`` method, but operates in place. - - .. ## Rect.union_ip ## - - .. method:: unionall - - | :sl:`the union of many rectangles` - | :sg:`unionall(Rect_sequence) -> Rect` - - Returns the union of one rectangle with a sequence of many rectangles. - - .. ## Rect.unionall ## - - .. method:: unionall_ip - - | :sl:`the union of many rectangles, in place` - | :sg:`unionall_ip(Rect_sequence) -> None` - - The same as the ``Rect.unionall()`` method, but operates in place. - - .. ## Rect.unionall_ip ## - - .. method:: fit - - | :sl:`resize and move a rectangle with aspect ratio` - | :sg:`fit(Rect) -> Rect` - - Returns a new rectangle that is moved and resized to fit another. The - aspect ratio of the original Rect is preserved, so the new rectangle may - be smaller than the target in either width or height. - - .. ## Rect.fit ## - - .. method:: normalize - - | :sl:`correct negative sizes` - | :sg:`normalize() -> None` - - This will flip the width or height of a rectangle if it has a negative - size. The rectangle will remain in the same place, with only the sides - swapped. - - .. ## Rect.normalize ## - - .. method:: contains - - | :sl:`test if one rectangle is inside another` - | :sg:`contains(Rect) -> bool` - - Returns true when the argument is completely inside the Rect. - - .. ## Rect.contains ## - - .. method:: collidepoint - - | :sl:`test if a point is inside a rectangle` - | :sg:`collidepoint(x, y) -> bool` - | :sg:`collidepoint((x,y)) -> bool` - - Returns true if the given point is inside the rectangle. A point along - the right or bottom edge is not considered to be inside the rectangle. - - .. ## Rect.collidepoint ## - - .. method:: colliderect - - | :sl:`test if two rectangles overlap` - | :sg:`colliderect(Rect) -> bool` - - Returns true if any portion of either rectangle overlap (except the - top+bottom or left+right edges). - - .. ## Rect.colliderect ## - - .. method:: collidelist - - | :sl:`test if one rectangle in a list intersects` - | :sg:`collidelist(list) -> index` - - Test whether the rectangle collides with any in a sequence of rectangles. - The index of the first collision found is returned. If no collisions are - found an index of -1 is returned. - - .. ## Rect.collidelist ## - - .. method:: collidelistall - - | :sl:`test if all rectangles in a list intersect` - | :sg:`collidelistall(list) -> indices` - - Returns a list of all the indices that contain rectangles that collide - with the Rect. If no intersecting rectangles are found, an empty list is - returned. - - .. ## Rect.collidelistall ## - - .. method:: collidedict - - | :sl:`test if one rectangle in a dictionary intersects` - | :sg:`collidedict(dict) -> (key, value)` - - Returns the key and value of the first dictionary value that collides - with the Rect. If no collisions are found, None is returned. - - Rect objects are not hashable and cannot be used as keys in a dictionary, - only as values. - - .. ## Rect.collidedict ## - - .. method:: collidedictall - - | :sl:`test if all rectangles in a dictionary intersect` - | :sg:`collidedictall(dict) -> [(key, value), ...]` - - Returns a list of all the key and value pairs that intersect with the - Rect. If no collisions are found an empty dictionary is returned. - - Rect objects are not hashable and cannot be used as keys in a dictionary, - only as values. - - .. ## Rect.collidedictall ## - - .. ## pygame.Rect ##
--- a/docs/_sources/ref/scrap.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.scrap` -=================== - -.. module:: pygame.scrap - :synopsis: pygame module for clipboard support. - -| :sl:`pygame module for clipboard support.` - -EXPERIMENTAL!: meaning this api may change, or dissapear in later pygame -releases. If you use this, your code will break with the next pygame release. - -The scrap module is for getting and putting stuff from the clipboard. So you -can copy and paste things between pygame, and other application types. It -defines some basic own data types - -:: - - SCRAP_PPM - SCRAP_PBM - SCRAP_BMP - SCRAP_TEXT - -to be placed into the clipboard and allows to use define own clipboard types. -``SCRAP_PPM``, ``SCRAP_PBM`` and ``SCRAP_BMP`` are suitable for surface buffers -to be shared with other applications, while ``SCRAP_TEXT`` is an alias for the -plain text clipboard type. - -The SCRAP_* types refer to the following ``MIME`` types and register those as -well as the default operating system type for this type of data: - -:: - - SCRAP_TEXT text/plain for plain text - SCRAP_PBM image/pbm for PBM encoded image data - SCRAP_PPM image/ppm for PPM encoded image data - SCRAP_BMP image/bmp for BMP encoded image data - -Depending on the platform additional types are automatically registered when -data is placed into the clipboard to guarantee a consistent sharing behaviour -with other applications. The following listed types can be used as string to be -passed to the respective :mod:`pygame.scrap` module functions. - -For Windows platforms, the additional types are supported automatically and -resolve to their internal definitions: - -:: - - text/plain;charset=utf-8 for UTF-8 encoded text - audio/wav for WAV encoded audio - image/tiff for TIFF encoded image data - -For ``X11`` platforms, the additional types are supported automatically and -resolve to their internal definitions: - -:: - - UTF8_STRING for UTF-8 encoded text - text/plain;charset=utf-8 for UTF-8 encoded text - COMPOUND_TEXT for COMPOUND text - -As stated before you can define own types for the clipboard, those however -might not be usable by other applications. Thus data pasted into the clipboard -using - -:: - - pygame.scrap.put ("own_data", data) - -can only be used by applications, which query the clipboard for the "own_data" -type. - -New in pygame 1.8. Only works for Windows, ``X11`` and Mac ``OS`` ``X`` so far. -On Mac ``OSX`` only text works at the moment - other types will be supported in -the next release. - -.. function:: init - - | :sl:`Initializes the scrap module.` - | :sg:`init () -> None` - - Tries to initialize the scrap module and raises an exception, if it fails. - Note that this module requires a set display surface, so you have to make - sure, you acquired one earlier using ``pygame.display.set_mode()``. - - .. ## pygame.scrap.init ## - -.. function:: get - - | :sl:`Gets the data for the specified type from the clipboard.` - | :sg:`get (type) -> bytes` - - Returns the data for the specified type from the clipboard. The data is - returned as a byte string and might need further processing, - such as decoding to Unicode. - If no data for the passed type is available, None is returned. - - :: - - text = pygame.scrap.get (SCRAP_TEXT) - if text: - # Do stuff with it. - else: - print "There does not seem to be text in the clipboard." - - .. ## pygame.scrap.get ## - -.. function:: get_types - - | :sl:`Gets a list of the available clipboard types.` - | :sg:`get_types () -> list` - - Gets a list of strings with the identifiers for the available clipboard - types. Each identifier can be used in the ``scrap.get()`` method to get the - clipboard content of the specific type. If there is no data in the - clipboard, an empty list is returned. - - :: - - types = pygame.scrap.get_types () - for t in types: - if "text" in t: - # There is some content with the word "text" in it. It's - # possibly text, so print it. - print pygame.scrap.get (t) - - .. ## pygame.scrap.get_types ## - -.. function:: put - - | :sl:`Places data into the clipboard.` - | :sg:`put(type, data) -> None` - - Places data for a specific clipboard type into the clipboard. The data must - be a string buffer. The type is a string identifying the type of data placed - into the clipboard. This can be one of the native ``SCRAP_PBM``, - ``SCRAP_PPM``, ``SCRAP_BMP`` or ``SCRAP_TEXT`` values or an own string - identifier. - - The method raises an exception, if the content could not be placed into the - clipboard. - - :: - - fp = open ("example.bmp", "rb") - pygame.scrap.put (SCRAP_BMP, fp.read ()) - fp.close () - # Now you can acquire the image data from the clipboard in other - # applications. - pygame.scrap.put (SCRAP_TEXT, "A text to copy") - pygame.scrap.put ("Plain text", "A text to copy") - - .. ## pygame.scrap.put ## - -.. function:: contains - - | :sl:`Checks, whether a certain type is available in the clipboard.` - | :sg:`contains (type) -> bool` - - Returns True, if data for the passed type is available in the clipboard, - False otherwise. - - :: - - if pygame.scrap.contains (SCRAP_TEXT): - print "There is text in the clipboard." - if pygame.scrap.contains ("own_data_type"): - print "There is stuff in the clipboard." - - .. ## pygame.scrap.contains ## - -.. function:: lost - - | :sl:`Checks whether the clipboard is currently owned by the application.` - | :sg:`lost() -> bool` - - Returns True, if the clipboard is currently owned by the pygame application, - False otherwise. - - :: - - if pygame.scrap.lost (): - print "No content from me anymore. The clipboard is used by someone else." - - .. ## pygame.scrap.lost ## - -.. function:: set_mode - - | :sl:`Sets the clipboard access mode.` - | :sg:`set_mode(mode) -> None` - - Sets the access mode for the clipboard. This is only of interest for ``X11`` - environments, where clipboard modes for mouse selections (SRAP_SELECTION) - and the clipboard (SCRAP_CLIPBOARD) are available. Setting the mode to - ``SCRAP_SELECTION`` in other environments will not cause any difference. - - If a value different from ``SCRAP_CLIPBOARD`` or ``SCRAP_SELECTION`` is - passed, a ValueError will be raised. - - .. ## pygame.scrap.set_mode ## - -.. ## pygame.scrap ##
--- a/docs/_sources/ref/sndarray.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.sndarray` -====================== - -.. module:: pygame.sndarray - :synopsis: pygame module for accessing sound sample data - -| :sl:`pygame module for accessing sound sample data` - -Functions to convert between Numeric or numpy arrays and Sound objects. This -module will only be available when pygame can use the external numpy or Numeric -package. - -Sound data is made of thousands of samples per second, and each sample is the -amplitude of the wave at a particular moment in time. For example, in 22-kHz -format, element number 5 of the array is the amplitude of the wave after -5/22000 seconds. - -Each sample is an 8-bit or 16-bit integer, depending on the data format. A -stereo sound file has two values per sample, while a mono sound file only has -one. - -Supported array systems are - -:: - - numpy - numeric (deprecated; to be removed in Pygame 1.9.3.) - -The default will be numpy, if installed. Otherwise, Numeric will be set as -default if installed, and a deprecation warning will be issued. If neither -numpy nor Numeric are installed, the module will raise an ImportError. - -The array type to use can be changed at runtime using the ``use_arraytype()`` -method, which requires one of the above types as string. - -Note: numpy and Numeric are not completely compatible. Certain array -manipulations, which work for one type, might behave differently or even -completely break for the other. - -Additionally, in contrast to Numeric numpy can use unsigned 16-bit integers. -Sounds with 16-bit data will be treated as unsigned integers, if the sound -sample type requests this. Numeric instead always uses signed integers for the -representation, which is important to keep in mind, if you use the module's -functions and wonder about the values. - -numpy support added in Pygame 1.8 Official Numeric deprecation begins in Pygame -1.9.2. - -.. function:: array - - | :sl:`copy Sound samples into an array` - | :sg:`array(Sound) -> array` - - Creates a new array for the sound data and copies the samples. The array - will always be in the format returned from ``pygame.mixer.get_init()``. - - .. ## pygame.sndarray.array ## - -.. function:: samples - - | :sl:`reference Sound samples into an array` - | :sg:`samples(Sound) -> array` - - Creates a new array that directly references the samples in a Sound object. - Modifying the array will change the Sound. The array will always be in the - format returned from ``pygame.mixer.get_init()``. - - .. ## pygame.sndarray.samples ## - -.. function:: make_sound - - | :sl:`convert an array into a Sound object` - | :sg:`make_sound(array) -> Sound` - - Create a new playable Sound object from an array. The mixer module must be - initialized and the array format must be similar to the mixer audio format. - - .. ## pygame.sndarray.make_sound ## - -.. function:: use_arraytype - - | :sl:`Sets the array system to be used for sound arrays` - | :sg:`use_arraytype (arraytype) -> None` - - Uses the requested array type for the module functions. Currently supported - array types are: - - :: - - numeric (deprecated; will be removed in Pygame 1.9.3.) - numpy - - If the requested type is not available, a ValueError will be raised. - - New in pygame 1.8. - - .. ## pygame.sndarray.use_arraytype ## - -.. function:: get_arraytype - - | :sl:`Gets the currently active array type.` - | :sg:`get_arraytype () -> str` - - Returns the currently active array type. This will be a value of the - ``get_arraytypes()`` tuple and indicates which type of array module is used - for the array creation. - - New in pygame 1.8 - - .. ## pygame.sndarray.get_arraytype ## - -.. function:: get_arraytypes - - | :sl:`Gets the array system types currently supported.` - | :sg:`get_arraytypes () -> tuple` - - Checks, which array systems are available and returns them as a tuple of - strings. The values of the tuple can be used directly in the - :func:`pygame.sndarray.use_arraytype` () method. If no supported array - system could be found, None will be returned. - - New in pygame 1.8. - - .. ## pygame.sndarray.get_arraytypes ## - -.. ## pygame.sndarray ##
--- a/docs/_sources/ref/sprite.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,810 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.sprite` -==================== - -.. module:: pygame.sprite - :synopsis: pygame module with basic game object classes - -| :sl:`pygame module with basic game object classes` - -This module contains several simple classes to be used within games. There is -the main Sprite class and several Group classes that contain Sprites. The use -of these classes is entirely optional when using Pygame. The classes are fairly -lightweight and only provide a starting place for the code that is common to -most games. - -The Sprite class is intended to be used as a base class for the different types -of objects in the game. There is also a base Group class that simply stores -sprites. A game could create new types of Group classes that operate on -specially customized Sprite instances they contain. - -The basic Sprite class can draw the Sprites it contains to a Surface. The -``Group.draw()`` method requires that each Sprite have a ``Surface.image`` -attribute and a ``Surface.rect``. The ``Group.clear()`` method requires these -same attributes, and can be used to erase all the Sprites with background. -There are also more advanced Groups: ``pygame.sprite.RenderUpdates()`` and -``pygame.sprite.OrderedUpdates()``. - -Lastly, this module contains several collision functions. These help find -sprites inside multiple groups that have intersecting bounding rectangles. To -find the collisions, the Sprites are required to have a ``Surface.rect`` -attribute assigned. - -The groups are designed for high efficiency in removing and adding Sprites to -them. They also allow cheap testing to see if a Sprite already exists in a -Group. A given Sprite can exist in any number of groups. A game could use some -groups to control object rendering, and a completely separate set of groups to -control interaction or player movement. Instead of adding type attributes or -bools to a derived Sprite class, consider keeping the Sprites inside organized -Groups. This will allow for easier lookup later in the game. - -Sprites and Groups manage their relationships with the ``add()`` and -``remove()`` methods. These methods can accept a single or multiple targets for -membership. The default initializers for these classes also takes a single or -list of targets for initial membership. It is safe to repeatedly add and remove -the same Sprite from a Group. - -While it is possible to design sprite and group classes that don't derive from -the Sprite and AbstractGroup classes below, it is strongly recommended that you -extend those when you add a Sprite or Group class. - -Sprites are not thread safe. So lock them yourself if using threads. - -.. class:: Sprite - - | :sl:`simple base class for visible game objects` - | :sg:`Sprite(*groups) -> Sprite` - - The base class for visible game objects. Derived classes will want to - override the ``Sprite.update()`` and assign a ``Sprite.image`` and - ``Sprite.rect`` attributes. The initializer can accept any number of Group - instances to be added to. - - When subclassing the Sprite, be sure to call the base initializer before - adding the Sprite to Groups. - - .. method:: update - - | :sl:`method to control sprite behavior` - | :sg:`update(*args) -> None` - - The default implementation of this method does nothing; it's just a - convenient "hook" that you can override. This method is called by - ``Group.update()`` with whatever arguments you give it. - - There is no need to use this method if not using the convenience method - by the same name in the Group class. - - .. ## Sprite.update ## - - .. method:: add - - | :sl:`add the sprite to groups` - | :sg:`add(*groups) -> None` - - Any number of Group instances can be passed as arguments. The Sprite will - be added to the Groups it is not already a member of. - - .. ## Sprite.add ## - - .. method:: remove - - | :sl:`remove the sprite from groups` - | :sg:`remove(*groups) -> None` - - Any number of Group instances can be passed as arguments. The Sprite will - be removed from the Groups it is currently a member of. - - .. ## Sprite.remove ## - - .. method:: kill - - | :sl:`remove the Sprite from all Groups` - | :sg:`kill() -> None` - - The Sprite is removed from all the Groups that contain it. This won't - change anything about the state of the Sprite. It is possible to continue - to use the Sprite after this method has been called, including adding it - to Groups. - - .. ## Sprite.kill ## - - .. method:: alive - - | :sl:`does the sprite belong to any groups` - | :sg:`alive() -> bool` - - Returns True when the Sprite belongs to one or more Groups. - - .. ## Sprite.alive ## - - .. method:: groups - - | :sl:`list of Groups that contain this Sprite` - | :sg:`groups() -> group_list` - - Return a list of all the Groups that contain this Sprite. - - .. ## Sprite.groups ## - - .. ## pygame.sprite.Sprite ## - -.. class:: DirtySprite - - | :sl:`a more featureful subclass of Sprite with more attributes` - | :sg:`DirtySprite(*groups) -> DirtySprite` - - Extra DirtySprite attributes with their default values: - - dirty = 1 - - :: - - if set to 1, it is repainted and then set to 0 again - if set to 2 then it is always dirty ( repainted each frame, - flag is not reset) - 0 means that it is not dirty and therefor not repainted again - - blendmode = 0 - - :: - - its the special_flags argument of blit, blendmodes - - source_rect = None - - :: - - source rect to use, remember that it is relative to - topleft (0,0) of self.image - - visible = 1 - - :: - - normally 1, if set to 0 it will not be repainted - (you must set it dirty too to be erased from screen) - - layer = 0 - - :: - - (READONLY value, it is read when adding it to the - LayeredDirty, for details see doc of LayeredDirty) - - .. ## ## - - .. ## pygame.sprite.DirtySprite ## - -.. class:: Group - - | :sl:`container class for many Sprites` - | :sg:`Group(*sprites) -> Group` - - A simple container for Sprite objects. This class can be inherited to create - containers with more specific behaviors. The constructor takes any number of - Sprite arguments to add to the Group. The group supports the following - standard Python operations: - - :: - - in test if a Sprite is contained - len the number of Sprites contained - bool test if any Sprites are contained - iter iterate through all the Sprites - - The Sprites in the Group are not ordered, so drawing and iterating the - Sprites is in no particular order. - - .. method:: sprites - - | :sl:`list of the Sprites this Group contains` - | :sg:`sprites() -> sprite_list` - - Return a list of all the Sprites this group contains. You can also get an - iterator from the group, but you cannot iterator over a Group while - modifying it. - - .. ## Group.sprites ## - - .. method:: copy - - | :sl:`duplicate the Group` - | :sg:`copy() -> Group` - - Creates a new Group with all the same Sprites as the original. If you - have subclassed Group, the new object will have the same (sub-)class as - the original. This only works if the derived class's constructor takes - the same arguments as the Group class's. - - .. ## Group.copy ## - - .. method:: add - - | :sl:`add Sprites to this Group` - | :sg:`add(*sprites) -> None` - - Add any number of Sprites to this Group. This will only add Sprites that - are not already members of the Group. - - Each sprite argument can also be a iterator containing Sprites. - - .. ## Group.add ## - - .. method:: remove - - | :sl:`remove Sprites from the Group` - | :sg:`remove(*sprites) -> None` - - Remove any number of Sprites from the Group. This will only remove - Sprites that are already members of the Group. - - Each sprite argument can also be a iterator containing Sprites. - - .. ## Group.remove ## - - .. method:: has - - | :sl:`test if a Group contains Sprites` - | :sg:`has(*sprites) -> None` - - Return True if the Group contains all of the given sprites. This is - similar to using the "in" operator on the Group ("if sprite in group: - ..."), which tests if a single Sprite belongs to a Group. - - Each sprite argument can also be a iterator containing Sprites. - - .. ## Group.has ## - - .. method:: update - - | :sl:`call the update method on contained Sprites` - | :sg:`update(*args) -> None` - - Calls the ``update()`` method on all Sprites in the Group. The base - Sprite class has an update method that takes any number of arguments and - does nothing. The arguments passed to ``Group.update()`` will be passed - to each Sprite. - - There is no way to get the return value from the ``Sprite.update()`` - methods. - - .. ## Group.update ## - - .. method:: draw - - | :sl:`blit the Sprite images` - | :sg:`draw(Surface) -> None` - - Draws the contained Sprites to the Surface argument. This uses the - ``Sprite.image`` attribute for the source surface, and ``Sprite.rect`` - for the position. - - The Group does not keep sprites in any order, so the draw order is - arbitrary. - - .. ## Group.draw ## - - .. method:: clear - - | :sl:`draw a background over the Sprites` - | :sg:`clear(Surface_dest, background) -> None` - - Erases the Sprites used in the last ``Group.draw()`` call. The - destination Surface is cleared by filling the drawn Sprite positions with - the background. - - The background is usually a Surface image the same dimensions as the - destination Surface. However, it can also be a callback function that - takes two arguments; the destination Surface and an area to clear. The - background callback function will be called several times each clear. - - Here is an example callback that will clear the Sprites with solid red: - - :: - - def clear_callback(surf, rect): - color = 255, 0, 0 - surf.fill(color, rect) - - .. ## Group.clear ## - - .. method:: empty - - | :sl:`remove all Sprites` - | :sg:`empty() -> None` - - Removes all Sprites from this Group. - - .. ## Group.empty ## - - .. ## pygame.sprite.Group ## - -.. class:: RenderPlain - - same as pygame.sprite.Group - -.. class:: RenderClear - - same as pygame.sprite.Group - - - -.. class:: RenderUpdates - - | :sl:`Group class that tracks dirty updates` - | :sg:`RenderUpdates(*sprites) -> RenderUpdates` - - This class is derived from ``pygame.sprite.Group()``. It has an extended - ``draw()`` method that tracks the changed areas of the screen. - - .. method:: draw - - | :sl:`blit the Sprite images and track changed areas` - | :sg:`draw(surface) -> Rect_list` - - Draws all the Sprites to the surface, the same as ``Group.draw()``. This - method also returns a list of Rectangular areas on the screen that have - been changed. The returned changes include areas of the screen that have - been affected by previous ``Group.clear()`` calls. - - The returned Rect list should be passed to ``pygame.display.update()``. - This will help performance on software driven display modes. This type of - updating is usually only helpful on destinations with non-animating - backgrounds. - - .. ## RenderUpdates.draw ## - - .. ## pygame.sprite.RenderUpdates ## - -.. function:: OrderedUpdates - - | :sl:`RenderUpdates class that draws Sprites in order of addition` - | :sg:`OrderedUpdates(*spites) -> OrderedUpdates` - - This class derives from ``pygame.sprite.RenderUpdates()``. It maintains the - order in which the Sprites were added to the Group for rendering. This makes - adding and removing Sprites from the Group a little slower than regular - Groups. - - .. ## pygame.sprite.OrderedUpdates ## - -.. class:: LayeredUpdates - - | :sl:`LayeredUpdates Group handles layers, that draws like OrderedUpdates.` - | :sg:`LayeredUpdates(*spites, **kwargs) -> LayeredUpdates` - - This group is fully compatible with :class:`pygame.sprite.Sprite`. - - You can set the default layer through kwargs using 'default_layer' and an - integer for the layer. The default layer is 0. - - If the sprite you add has an attribute layer then that layer will be used. - If the \**kwarg contains 'layer' then the sprites passed will be added to - that layer (overriding the ``sprite.layer`` attribute). If neither sprite - has attribute layer nor \**kwarg then the default layer is used to add the - sprites. - - New in pygame 1.8.0 - - .. method:: add - - | :sl:`add a sprite or sequence of sprites to a group` - | :sg:`add(*sprites, **kwargs) -> None` - - If the ``sprite(s)`` have an attribute layer then that is used for the - layer. If \**kwargs contains 'layer' then the ``sprite(s)`` will be added - to that argument (overriding the sprite layer attribute). If neither is - passed then the ``sprite(s)`` will be added to the default layer. - - .. ## LayeredUpdates.add ## - - .. method:: sprites - - | :sl:`returns a ordered list of sprites (first back, last top).` - | :sg:`sprites() -> sprites` - - .. ## LayeredUpdates.sprites ## - - .. method:: draw - - | :sl:`draw all sprites in the right order onto the passed surface.` - | :sg:`draw(surface) -> Rect_list` - - .. ## LayeredUpdates.draw ## - - .. method:: get_sprites_at - - | :sl:`returns a list with all sprites at that position.` - | :sg:`get_sprites_at(pos) -> colliding_sprites` - - Bottom sprites first, top last. - - .. ## LayeredUpdates.get_sprites_at ## - - .. method:: get_sprite - - | :sl:`returns the sprite at the index idx from the groups sprites` - | :sg:`get_sprite(idx) -> sprite` - - Raises IndexOutOfBounds if the idx is not within range. - - .. ## LayeredUpdates.get_sprite ## - - .. method:: remove_sprites_of_layer - - | :sl:`removes all sprites from a layer and returns them as a list.` - | :sg:`remove_sprites_of_layer(layer_nr) -> sprites` - - .. ## LayeredUpdates.remove_sprites_of_layer ## - - .. method:: layers - - | :sl:`returns a list of layers defined (unique), sorted from botton up.` - | :sg:`layers() -> layers` - - .. ## LayeredUpdates.layers ## - - .. method:: change_layer - - | :sl:`changes the layer of the sprite` - | :sg:`change_layer(sprite, new_layer) -> None` - - sprite must have been added to the renderer. It is not checked. - - .. ## LayeredUpdates.change_layer ## - - .. method:: get_layer_of_sprite - - | :sl:`returns the layer that sprite is currently in.` - | :sg:`get_layer_of_sprite(sprite) -> layer` - - If the sprite is not found then it will return the default layer. - - .. ## LayeredUpdates.get_layer_of_sprite ## - - .. method:: get_top_layer - - | :sl:`returns the top layer` - | :sg:`get_top_layer() -> layer` - - .. ## LayeredUpdates.get_top_layer ## - - .. method:: get_bottom_layer - - | :sl:`returns the bottom layer` - | :sg:`get_bottom_layer() -> layer` - - .. ## LayeredUpdates.get_bottom_layer ## - - .. method:: move_to_front - - | :sl:`brings the sprite to front layer` - | :sg:`move_to_front(sprite) -> None` - - Brings the sprite to front, changing sprite layer to topmost layer (added - at the end of that layer). - - .. ## LayeredUpdates.move_to_front ## - - .. method:: move_to_back - - | :sl:`moves the sprite to the bottom layer` - | :sg:`move_to_back(sprite) -> None` - - Moves the sprite to the bottom layer, moving it behind all other layers - and adding one additional layer. - - .. ## LayeredUpdates.move_to_back ## - - .. method:: get_top_sprite - - | :sl:`returns the topmost sprite` - | :sg:`get_top_sprite() -> Sprite` - - .. ## LayeredUpdates.get_top_sprite ## - - .. method:: get_sprites_from_layer - - | :sl:`returns all sprites from a layer, ordered by how they where added` - | :sg:`get_sprites_from_layer(layer) -> sprites` - - Returns all sprites from a layer, ordered by how they where added. It - uses linear search and the sprites are not removed from layer. - - .. ## LayeredUpdates.get_sprites_from_layer ## - - .. method:: switch_layer - - | :sl:`switches the sprites from layer1 to layer2` - | :sg:`switch_layer(layer1_nr, layer2_nr) -> None` - - The layers number must exist, it is not checked. - - .. ## LayeredUpdates.switch_layer ## - - .. ## pygame.sprite.LayeredUpdates ## - -.. class:: LayeredDirty - - | :sl:`LayeredDirty Group is for DirtySprites. Subclasses LayeredUpdates.` - | :sg:`LayeredDirty(*spites, **kwargs) -> LayeredDirty` - - This group requires :class:`pygame.sprite.DirtySprite` or any sprite that - has the following attributes: - - :: - - image, rect, dirty, visible, blendmode (see doc of DirtySprite). - - It uses the dirty flag technique and is therefore faster than the - :class:`pygame.sprite.RenderUpdates` if you have many static sprites. It - also switches automatically between dirty rect update and full screen - drawing, so you do no have to worry what would be faster. - - Same as for the :class:`pygame.sprite.Group`. You can specify some - additional attributes through kwargs: - - :: - - _use_update: True/False default is False - _default_layer: default layer where sprites without a layer are added. - _time_threshold: treshold time for switching between dirty rect mode - and fullscreen mode, defaults to 1000./80 == 1000./fps - - New in pygame 1.8.0 - - .. method:: draw - - | :sl:`draw all sprites in the right order onto the passed surface.` - | :sg:`draw(surface, bgd=None) -> Rect_list` - - You can pass the background too. If a background is already set, then the - bgd argument has no effect. - - .. ## LayeredDirty.draw ## - - .. method:: clear - - | :sl:`used to set background` - | :sg:`clear(surface, bgd) -> None` - - .. ## LayeredDirty.clear ## - - .. method:: repaint_rect - - | :sl:`repaints the given area` - | :sg:`repaint_rect(screen_rect) -> None` - - screen_rect is in screencoordinates. This method does not do any drawing by itself; the area specified by the rect attributes will be redrawn when the draw method is called. - - .. ## LayeredDirty.repaint_rect ## - - .. method:: set_clip - - | :sl:`clip the area where to draw. Just pass None (default) to reset the clip` - | :sg:`set_clip(screen_rect=None) -> None` - - .. ## LayeredDirty.set_clip ## - - .. method:: get_clip - - | :sl:`get the area where drawing will occur` - | :sg:`get_clip() -> Rect` - - .. ## LayeredDirty.get_clip ## - - .. method:: change_layer - - | :sl:`changes the layer of the sprite` - | :sg:`change_layer(sprite, new_layer) -> None` - - sprite must have been added to the renderer. It is not checked. - - .. ## LayeredDirty.change_layer ## - - .. method:: set_timing_treshold - - | :sl:`sets the treshold in milliseconds` - | :sg:`set_timing_treshold(time_ms) -> None` - - Default is 1000./80 where 80 is the fps I want to switch to full screen - mode. - - .. ## LayeredDirty.set_timing_treshold ## - - .. ## pygame.sprite.LayeredDirty ## - -.. function:: GroupSingle - - | :sl:`Group container that holds a single Sprite` - | :sg:`GroupSingle(sprite=None) -> GroupSingle` - - The GroupSingle container only holds a single Sprite. When a new Sprite is - added, the old one is removed. - - There is a special property, ``GroupSingle.sprite``, that accesses the - Sprite that this Group contains. It can be None when the Group is empty. The - property can also be assigned to add a Sprite into the GroupSingle - container. - - .. ## pygame.sprite.GroupSingle ## - -.. function:: spritecollide - - | :sl:`find Sprites in a Group that intersect another Sprite` - | :sg:`spritecollide(sprite, group, dokill, collided = None) -> Sprite_list` - - Return a list containing all Sprites in a Group that intersect with another - Sprite. Intersection is determined by comparing the ``Sprite.rect`` - attribute of each Sprite. - - The dokill argument is a bool. If set to True, all Sprites that collide will - be removed from the Group. - - The collided argument is a callback function used to calculate if two - sprites are colliding. it should take two sprites as values, and return a - bool value indicating if they are colliding. If collided is not passed, all - sprites must have a "rect" value, which is a rectangle of the sprite area, - which will be used to calculate the collision. - - collided callables: - - :: - - collide_rect, collide_rect_ratio, collide_circle, - collide_circle_ratio, collide_mask - - .. ## pygame.sprite.spritecollide ## - -.. function:: collide_rect - - | :sl:`collision detection between two sprites, using rects.` - | :sg:`collide_rect(left, right) -> bool` - - Tests for collision between two sprites. Uses the pygame rect colliderect - function to calculate the collision. Intended to be passed as a collided - callback function to the \*collide functions. Sprites must have a "rect" - attributes. - - New in pygame 1.8.0 - - .. ## pygame.sprite.collide_rect ## - -.. function:: collide_rect_ratio - - | :sl:`collision detection between two sprites, using rects scaled to a ratio.` - | :sg:`collide_rect_ratio(ratio) -> collided_callable` - - A callable class that checks for collisions between two sprites, using a - scaled version of the sprites rects. - - Is created with a ratio, the instance is then intended to be passed as a - collided callback function to the \*collide functions. - - A ratio is a floating point number - 1.0 is the same size, 2.0 is twice as - big, and 0.5 is half the size. - - New in pygame 1.8.1 - - .. ## pygame.sprite.collide_rect_ratio ## - -.. function:: collide_circle - - | :sl:`collision detection between two sprites, using circles.` - | :sg:`collide_circle(left, right) -> bool` - - Tests for collision between two sprites, by testing to see if two circles - centered on the sprites overlap. If the sprites have a "radius" attribute, - that is used to create the circle, otherwise a circle is created that is big - enough to completely enclose the sprites rect as given by the "rect" - attribute. Intended to be passed as a collided callback function to the - \*collide functions. Sprites must have a "rect" and an optional "radius" - attribute. - - New in pygame 1.8.1 - - .. ## pygame.sprite.collide_circle ## - -.. function:: collide_circle_ratio - - | :sl:`collision detection between two sprites, using circles scaled to a ratio.` - | :sg:`collide_circle_ratio(ratio) -> collided_callable` - - A callable class that checks for collisions between two sprites, using a - scaled version of the sprites radius. - - Is created with a floating point ratio, the instance is then intended to be - passed as a collided callback function to the \*collide functions. - - A ratio is a floating point number - 1.0 is the same size, 2.0 is twice as - big, and 0.5 is half the size. - - The created callable tests for collision between two sprites, by testing to - see if two circles centered on the sprites overlap, after scaling the - circles radius by the stored ratio. If the sprites have a "radius" - attribute, that is used to create the circle, otherwise a circle is created - that is big enough to completely enclose the sprites rect as given by the - "rect" attribute. Intended to be passed as a collided callback function to - the \*collide functions. Sprites must have a "rect" and an optional "radius" - attribute. - - New in pygame 1.8.1 - - .. ## pygame.sprite.collide_circle_ratio ## - -.. function:: collide_mask - - | :sl:`collision detection between two sprites, using masks.` - | :sg:`collide_mask(SpriteLeft, SpriteRight) -> point` - - Returns first point on the mask where the masks collided, or None if - there was no collision. - - Tests for collision between two sprites, by testing if thier bitmasks - overlap. If the sprites have a "mask" attribute, that is used as the mask, - otherwise a mask is created from the sprite image. Intended to be passed as - a collided callback function to the \*collide functions. Sprites must have a - "rect" and an optional "mask" attribute. - - You should consider creating a mask for your sprite at load time if you - are going to check collisions many times. This will increase the - performance, otherwise this can be an expensive function because it - will create the masks each time you check for collisions. - - :: - - sprite.mask = pygame.mask.from_surface(sprite.image) - - - New in pygame 1.8.0 - - .. ## pygame.sprite.collide_mask ## - -.. function:: groupcollide - - | :sl:`find all Sprites that collide between two Groups` - | :sg:`groupcollide(group1, group2, dokill1, dokill2, collided = None) -> Sprite_dict` - - This will find collisions between all the Sprites in two groups. - Collision is determined by comparing the ``Sprite.rect`` attribute of - each Sprite or by using the collided function if it is not None. - - Every Sprite inside group1 is added to the return dictionary. The value for - each item is the list of Sprites in group2 that intersect. - - If either dokill argument is True, the colliding Sprites will be removed - from their respective Group. - - The collided argument is a callback function used to calculate if two sprites are - colliding. It should take two sprites as values and return a bool value - indicating if they are colliding. If collided is not passed, then all - sprites must have a "rect" value, which is a rectangle of the sprite area, - which will be used to calculate the collision. - - .. ## pygame.sprite.groupcollide ## - -.. function:: spritecollideany - - | :sl:`simple test if a Sprite intersects anything in a Group` - | :sg:`spritecollideany(sprite, group, collided = None) -> Sprite` Collision with the returned sprite. - | :sg:`spritecollideany(sprite, group, collided = None) -> None` No collision - - If the sprite collides with any single sprite in the group, a single - sprite from the group is returned. On no collision None is returned. - - If you don't need all the features of the ``pygame.sprite.spritecollide()`` function, this - function will be a bit quicker. - - The collided argument is a callback function used to calculate if two sprites are - colliding. It should take two sprites as values and return a bool value - indicating if they are colliding. If collided is not passed, then all - sprites must have a "rect" value, which is a rectangle of the sprite area, - which will be used to calculate the collision. - - .. ## pygame.sprite.spritecollideany ## - -.. ## ## - -.. ## pygame.sprite ##
--- a/docs/_sources/ref/surface.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,833 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.Surface` -===================== - -.. currentmodule:: pygame - -.. class:: Surface - - | :sl:`pygame object for representing images` - | :sg:`Surface((width, height), flags=0, depth=0, masks=None) -> Surface` - | :sg:`Surface((width, height), flags=0, Surface) -> Surface` - - A pygame Surface is used to represent any image. The Surface has a fixed - resolution and pixel format. Surfaces with 8bit pixels use a color palette - to map to 24bit color. - - Call ``pygame.Surface()`` to create a new image object. The Surface will be - cleared to all black. The only required arguments are the sizes. With no - additional arguments, the Surface will be created in a format that best - matches the display Surface. - - The pixel format can be controlled by passing the bit depth or an existing - Surface. The flags argument is a bitmask of additional features for the - surface. You can pass any combination of these flags: - - :: - - HWSURFACE, creates the image in video memory - SRCALPHA, the pixel format will include a per-pixel alpha - - Both flags are only a request, and may not be possible for all displays and - formats. - - Advance users can combine a set of bitmasks with a depth value. The masks - are a set of 4 integers representing which bits in a pixel will represent - each color. Normal Surfaces should not require the masks argument. - - Surfaces can have many extra attributes like alpha planes, colorkeys, source - rectangle clipping. These functions mainly effect how the Surface is blitted - to other Surfaces. The blit routines will attempt to use hardware - acceleration when possible, otherwise they will use highly optimized - software blitting methods. - - There are three types of transparency supported in Pygame: colorkeys, - surface alphas, and pixel alphas. Surface alphas can be mixed with - colorkeys, but an image with per pixel alphas cannot use the other modes. - Colorkey transparency makes a single color value transparent. Any pixels - matching the colorkey will not be drawn. The surface alpha value is a single - value that changes the transparency for the entire image. A surface alpha of - 255 is opaque, and a value of 0 is completely transparent. - - Per pixel alphas are different because they store a transparency value for - every pixel. This allows for the most precise transparency effects, but it - also the slowest. Per pixel alphas cannot be mixed with surface alpha and - colorkeys. - - There is support for pixel access for the Surfaces. Pixel access on hardware - surfaces is slow and not recommended. Pixels can be accessed using the - ``get_at()`` and ``set_at()`` functions. These methods are fine for simple - access, but will be considerably slow when doing of pixel work with them. If - you plan on doing a lot of pixel level work, it is recommended to use a - :class:`pygame.PixelArray`, which gives an array like view of the surface. - For involved mathematical manipulations try the :mod:`pygame.surfarray` - module (It's quite quick, but requires NumPy.) - - Any functions that directly access a surface's pixel data will need that - surface to be lock()'ed. These functions can ``lock()`` and ``unlock()`` the - surfaces themselves without assistance. But, if a function will be called - many times, there will be a lot of overhead for multiple locking and - unlocking of the surface. It is best to lock the surface manually before - making the function call many times, and then unlocking when you are - finished. All functions that need a locked surface will say so in their - docs. Remember to leave the Surface locked only while necessary. - - Surface pixels are stored internally as a single number that has all the - colors encoded into it. Use the ``Surface.map_rgb()`` and - ``Surface.unmap_rgb()`` to convert between individual red, green, and blue - values into a packed integer for that Surface. - - Surfaces can also reference sections of other Surfaces. These are created - with the ``Surface.subsurface()`` method. Any change to either Surface will - effect the other. - - Each Surface contains a clipping area. By default the clip area covers the - entire Surface. If it is changed, all drawing operations will only effect - the smaller area. - - .. method:: blit - - | :sl:`draw one image onto another` - | :sg:`blit(source, dest, area=None, special_flags = 0) -> Rect` - - Draws a source Surface onto this Surface. The draw can be positioned with - the dest argument. Dest can either be pair of coordinates representing - the upper left corner of the source. A Rect can also be passed as the - destination and the topleft corner of the rectangle will be used as the - position for the blit. The size of the destination rectangle does not - effect the blit. - - An optional area rectangle can be passed as well. This represents a - smaller portion of the source Surface to draw. - - An optional special flags is for passing in new in 1.8.0: ``BLEND_ADD``, - ``BLEND_SUB``, ``BLEND_MULT``, ``BLEND_MIN``, ``BLEND_MAX`` new in 1.8.1: - ``BLEND_RGBA_ADD``, ``BLEND_RGBA_SUB``, ``BLEND_RGBA_MULT``, - ``BLEND_RGBA_MIN``, ``BLEND_RGBA_MAX`` ``BLEND_RGB_ADD``, - ``BLEND_RGB_SUB``, ``BLEND_RGB_MULT``, ``BLEND_RGB_MIN``, - ``BLEND_RGB_MAX`` With other special blitting flags perhaps added in the - future. - - The return rectangle is the area of the affected pixels, excluding any - pixels outside the destination Surface, or outside the clipping area. - - Pixel alphas will be ignored when blitting to an 8 bit Surface. - - special_flags new in pygame 1.8. - - For a surface with colorkey or blanket alpha, a blit to self may give - slightly different colors than a non self-blit. - - .. ## Surface.blit ## - - .. method:: convert - - | :sl:`change the pixel format of an image` - | :sg:`convert(Surface) -> Surface` - | :sg:`convert(depth, flags=0) -> Surface` - | :sg:`convert(masks, flags=0) -> Surface` - | :sg:`convert() -> Surface` - - Creates a new copy of the Surface with the pixel format changed. The new - pixel format can be determined from another existing Surface. Otherwise - depth, flags, and masks arguments can be used, similar to the - ``pygame.Surface()`` call. - - If no arguments are passed the new Surface will have the same pixel - format as the display Surface. This is always the fastest format for - blitting. It is a good idea to convert all Surfaces before they are - blitted many times. - - The converted Surface will have no pixel alphas. They will be stripped if - the original had them. See ``Surface.convert_alpha()`` for preserving or - creating per-pixel alphas. - - .. ## Surface.convert ## - - .. method:: convert_alpha - - | :sl:`change the pixel format of an image including per pixel alphas` - | :sg:`convert_alpha(Surface) -> Surface` - | :sg:`convert_alpha() -> Surface` - - Creates a new copy of the surface with the desired pixel format. The new - surface will be in a format suited for quick blitting to the given format - with per pixel alpha. If no surface is given, the new surface will be - optimized for blitting to the current display. - - Unlike the ``Surface.convert()`` method, the pixel format for the new - image will not be exactly the same as the requested source, but it will - be optimized for fast alpha blitting to the destination. - - .. ## Surface.convert_alpha ## - - .. method:: copy - - | :sl:`create a new copy of a Surface` - | :sg:`copy() -> Surface` - - Makes a duplicate copy of a Surface. The new Surface will have the same - pixel formats, color palettes, and transparency settings as the original. - - .. ## Surface.copy ## - - .. method:: fill - - | :sl:`fill Surface with a solid color` - | :sg:`fill(color, rect=None, special_flags=0) -> Rect` - - Fill the Surface with a solid color. If no rect argument is given the - entire Surface will be filled. The rect argument will limit the fill to a - specific area. The fill will also be contained by the Surface clip area. - - The color argument can be either a ``RGB`` sequence, a ``RGBA`` sequence - or a mapped color index. If using ``RGBA``, the Alpha (A part of - ``RGBA``) is ignored unless the surface uses per pixel alpha (Surface has - the ``SRCALPHA`` flag). - - An optional special_flags is for passing in new in 1.8.0: ``BLEND_ADD``, - ``BLEND_SUB``, ``BLEND_MULT``, ``BLEND_MIN``, ``BLEND_MAX`` new in 1.8.1: - ``BLEND_RGBA_ADD``, ``BLEND_RGBA_SUB``, ``BLEND_RGBA_MULT``, - ``BLEND_RGBA_MIN``, ``BLEND_RGBA_MAX`` ``BLEND_RGB_ADD``, - ``BLEND_RGB_SUB``, ``BLEND_RGB_MULT``, ``BLEND_RGB_MIN``, - ``BLEND_RGB_MAX`` With other special blitting flags perhaps added in the - future. - - This will return the affected Surface area. - - .. ## Surface.fill ## - - .. method:: scroll - - | :sl:`Shift the surface image in place` - | :sg:`scroll(dx=0, dy=0) -> None` - - Move the image by dx pixels right and dy pixels down. dx and dy may be - negative for left and up scrolls respectively. Areas of the surface that - are not overwritten retain their original pixel values. Scrolling is - contained by the Surface clip area. It is safe to have dx and dy values - that exceed the surface size. - - New in Pygame 1.9 - - .. ## Surface.scroll ## - - .. method:: set_colorkey - - | :sl:`Set the transparent colorkey` - | :sg:`set_colorkey(Color, flags=0) -> None` - | :sg:`set_colorkey(None) -> None` - - Set the current color key for the Surface. When blitting this Surface - onto a destination, and pixels that have the same color as the colorkey - will be transparent. The color can be an ``RGB`` color or a mapped color - integer. If None is passed, the colorkey will be unset. - - The colorkey will be ignored if the Surface is formatted to use per pixel - alpha values. The colorkey can be mixed with the full Surface alpha - value. - - The optional flags argument can be set to ``pygame.RLEACCEL`` to provide - better performance on non accelerated displays. An ``RLEACCEL`` Surface - will be slower to modify, but quicker to blit as a source. - - .. ## Surface.set_colorkey ## - - .. method:: get_colorkey - - | :sl:`Get the current transparent colorkey` - | :sg:`get_colorkey() -> RGB or None` - - Return the current colorkey value for the Surface. If the colorkey is not - set then None is returned. - - .. ## Surface.get_colorkey ## - - .. method:: set_alpha - - | :sl:`set the alpha value for the full Surface image` - | :sg:`set_alpha(value, flags=0) -> None` - | :sg:`set_alpha(None) -> None` - - Set the current alpha value fo r the Surface. When blitting this Surface - onto a destination, the pixels will be drawn slightly transparent. The - alpha value is an integer from 0 to 255, 0 is fully transparent and 255 - is fully opaque. If None is passed for the alpha value, then the Surface - alpha will be disabled. - - This value is different than the per pixel Surface alpha. If the Surface - format contains per pixel alphas, then this alpha value will be ignored. - If the Surface contains per pixel alphas, setting the alpha value to None - will disable the per pixel transparency. - - The optional flags argument can be set to ``pygame.RLEACCEL`` to provide - better performance on non accelerated displays. An ``RLEACCEL`` Surface - will be slower to modify, but quicker to blit as a source. - - .. ## Surface.set_alpha ## - - .. method:: get_alpha - - | :sl:`get the current Surface transparency value` - | :sg:`get_alpha() -> int_value or None` - - Return the current alpha value for the Surface. If the alpha value is not - set then None is returned. - - .. ## Surface.get_alpha ## - - .. method:: lock - - | :sl:`lock the Surface memory for pixel access` - | :sg:`lock() -> None` - - Lock the pixel data of a Surface for access. On accelerated Surfaces, the - pixel data may be stored in volatile video memory or nonlinear compressed - forms. When a Surface is locked the pixel memory becomes available to - access by regular software. Code that reads or writes pixel values will - need the Surface to be locked. - - Surfaces should not remain locked for more than necessary. A locked - Surface can often not be displayed or managed by Pygame. - - Not all Surfaces require locking. The ``Surface.mustlock()`` method can - determine if it is actually required. There is no performance penalty for - locking and unlocking a Surface that does not need it. - - All pygame functions will automatically lock and unlock the Surface data - as needed. If a section of code is going to make calls that will - repeatedly lock and unlock the Surface many times, it can be helpful to - wrap the block inside a lock and unlock pair. - - It is safe to nest locking and unlocking calls. The surface will only be - unlocked after the final lock is released. - - .. ## Surface.lock ## - - .. method:: unlock - - | :sl:`unlock the Surface memory from pixel access` - | :sg:`unlock() -> None` - - Unlock the Surface pixel data after it has been locked. The unlocked - Surface can once again be drawn and managed by Pygame. See the - ``Surface.lock()`` documentation for more details. - - All pygame functions will automatically lock and unlock the Surface data - as needed. If a section of code is going to make calls that will - repeatedly lock and unlock the Surface many times, it can be helpful to - wrap the block inside a lock and unlock pair. - - It is safe to nest locking and unlocking calls. The surface will only be - unlocked after the final lock is released. - - .. ## Surface.unlock ## - - .. method:: mustlock - - | :sl:`test if the Surface requires locking` - | :sg:`mustlock() -> bool` - - Returns True if the Surface is required to be locked to access pixel - data. Usually pure software Surfaces do not require locking. This method - is rarely needed, since it is safe and quickest to just lock all Surfaces - as needed. - - All pygame functions will automatically lock and unlock the Surface data - as needed. If a section of code is going to make calls that will - repeatedly lock and unlock the Surface many times, it can be helpful to - wrap the block inside a lock and unlock pair. - - .. ## Surface.mustlock ## - - .. method:: get_locked - - | :sl:`test if the Surface is current locked` - | :sg:`get_locked() -> bool` - - Returns True when the Surface is locked. It doesn't matter how many times - the Surface is locked. - - .. ## Surface.get_locked ## - - .. method:: get_locks - - | :sl:`Gets the locks for the Surface` - | :sg:`get_locks() -> tuple` - - Returns the currently existing locks for the Surface. - - .. ## Surface.get_locks ## - - .. method:: get_at - - | :sl:`get the color value at a single pixel` - | :sg:`get_at((x, y)) -> Color` - - Return a copy of the ``RGBA`` Color value at the given pixel. If the - Surface has no per pixel alpha, then the alpha value will always be 255 - (opaque). If the pixel position is outside the area of the Surface an - IndexError exception will be raised. - - Getting and setting pixels one at a time is generally too slow to be used - in a game or realtime situation. It is better to use methods which - operate on many pixels at a time like with the blit, fill and draw - methods - or by using surfarray/PixelArray. - - This function will temporarily lock and unlock the Surface as needed. - - Returning a Color instead of tuple, New in pygame 1.9.0. Use - ``tuple(surf.get_at((x,y)))`` if you want a tuple, and not a Color. This - should only matter if you want to use the color as a key in a dict. - - .. ## Surface.get_at ## - - .. method:: set_at - - | :sl:`set the color value for a single pixel` - | :sg:`set_at((x, y), Color) -> None` - - Set the ``RGBA`` or mapped integer color value for a single pixel. If the - Surface does not have per pixel alphas, the alpha value is ignored. - Settting pixels outside the Surface area or outside the Surface clipping - will have no effect. - - Getting and setting pixels one at a time is generally too slow to be used - in a game or realtime situation. - - This function will temporarily lock and unlock the Surface as needed. - - .. ## Surface.set_at ## - - .. method:: get_at_mapped - - | :sl:`get the mapped color value at a single pixel` - | :sg:`get_at_mapped((x, y)) -> Color` - - Return the integer value of the given pixel. If the pixel position is - outside the area of the Surface an IndexError exception will be raised. - - This method is intended for Pygame unit testing. It unlikely has any use - in an application. - - This function will temporarily lock and unlock the Surface as needed. - - New in pygame. 1.9.2. - - .. ## Surface.get_at_mapped ## - - .. method:: get_palette - - | :sl:`get the color index palette for an 8bit Surface` - | :sg:`get_palette() -> [RGB, RGB, RGB, ...]` - - Return a list of up to 256 color elements that represent the indexed - colors used in an 8bit Surface. The returned list is a copy of the - palette, and changes will have no effect on the Surface. - - Returning a list of ``Color(with length 3)`` instances instead of tuples, - New in pygame 1.9.0 - - .. ## Surface.get_palette ## - - .. method:: get_palette_at - - | :sl:`get the color for a single entry in a palette` - | :sg:`get_palette_at(index) -> RGB` - - Returns the red, green, and blue color values for a single index in a - Surface palette. The index should be a value from 0 to 255. - - Returning ``Color(with length 3)`` instance instead of a tuple, New in - pygame 1.9.0 - - .. ## Surface.get_palette_at ## - - .. method:: set_palette - - | :sl:`set the color palette for an 8bit Surface` - | :sg:`set_palette([RGB, RGB, RGB, ...]) -> None` - - Set the full palette for an 8bit Surface. This will replace the colors in - the existing palette. A partial palette can be passed and only the first - colors in the original palette will be changed. - - This function has no effect on a Surface with more than 8bits per pixel. - - .. ## Surface.set_palette ## - - .. method:: set_palette_at - - | :sl:`set the color for a single index in an 8bit Surface palette` - | :sg:`set_palette_at(index, RGB) -> None` - - Set the palette value for a single entry in a Surface palette. The index - should be a value from 0 to 255. - - This function has no effect on a Surface with more than 8bits per pixel. - - .. ## Surface.set_palette_at ## - - .. method:: map_rgb - - | :sl:`convert a color into a mapped color value` - | :sg:`map_rgb(Color) -> mapped_int` - - Convert an ``RGBA`` color into the mapped integer value for this Surface. - The returned integer will contain no more bits than the bit depth of the - Surface. Mapped color values are not often used inside Pygame, but can be - passed to most functions that require a Surface and a color. - - See the Surface object documentation for more information about colors - and pixel formats. - - .. ## Surface.map_rgb ## - - .. method:: unmap_rgb - - | :sl:`convert a mapped integer color value into a Color` - | :sg:`unmap_rgb(mapped_int) -> Color` - - Convert an mapped integer color into the ``RGB`` color components for - this Surface. Mapped color values are not often used inside Pygame, but - can be passed to most functions that require a Surface and a color. - - See the Surface object documentation for more information about colors - and pixel formats. - - .. ## Surface.unmap_rgb ## - - .. method:: set_clip - - | :sl:`set the current clipping area of the Surface` - | :sg:`set_clip(rect) -> None` - | :sg:`set_clip(None) -> None` - - Each Surface has an active clipping area. This is a rectangle that - represents the only pixels on the Surface that can be modified. If None - is passed for the rectangle the full Surface will be available for - changes. - - The clipping area is always restricted to the area of the Surface itself. - If the clip rectangle is too large it will be shrunk to fit inside the - Surface. - - .. ## Surface.set_clip ## - - .. method:: get_clip - - | :sl:`get the current clipping area of the Surface` - | :sg:`get_clip() -> Rect` - - Return a rectangle of the current clipping area. The Surface will always - return a valid rectangle that will never be outside the bounds of the - image. If the Surface has had None set for the clipping area, the Surface - will return a rectangle with the full area of the Surface. - - .. ## Surface.get_clip ## - - .. method:: subsurface - - | :sl:`create a new surface that references its parent` - | :sg:`subsurface(Rect) -> Surface` - - Returns a new Surface that shares its pixels with its new parent. The new - Surface is considered a child of the original. Modifications to either - Surface pixels will effect each other. Surface information like clipping - area and color keys are unique to each Surface. - - The new Surface will inherit the palette, color key, and alpha settings - from its parent. - - It is possible to have any number of subsurfaces and subsubsurfaces on - the parent. It is also possible to subsurface the display Surface if the - display mode is not hardware accelerated. - - See the ``Surface.get_offset()``, ``Surface.get_parent()`` to learn more - about the state of a subsurface. - - .. ## Surface.subsurface ## - - .. method:: get_parent - - | :sl:`find the parent of a subsurface` - | :sg:`get_parent() -> Surface` - - Returns the parent Surface of a subsurface. If this is not a subsurface - then None will be returned. - - .. ## Surface.get_parent ## - - .. method:: get_abs_parent - - | :sl:`find the top level parent of a subsurface` - | :sg:`get_abs_parent() -> Surface` - - Returns the parent Surface of a subsurface. If this is not a subsurface - then this surface will be returned. - - .. ## Surface.get_abs_parent ## - - .. method:: get_offset - - | :sl:`find the position of a child subsurface inside a parent` - | :sg:`get_offset() -> (x, y)` - - Get the offset position of a child subsurface inside of a parent. If the - Surface is not a subsurface this will return (0, 0). - - .. ## Surface.get_offset ## - - .. method:: get_abs_offset - - | :sl:`find the absolute position of a child subsurface inside its top level parent` - | :sg:`get_abs_offset() -> (x, y)` - - Get the offset position of a child subsurface inside of its top level - parent Surface. If the Surface is not a subsurface this will return (0, - 0). - - .. ## Surface.get_abs_offset ## - - .. method:: get_size - - | :sl:`get the dimensions of the Surface` - | :sg:`get_size() -> (width, height)` - - Return the width and height of the Surface in pixels. - - .. ## Surface.get_size ## - - .. method:: get_width - - | :sl:`get the width of the Surface` - | :sg:`get_width() -> width` - - Return the width of the Surface in pixels. - - .. ## Surface.get_width ## - - .. method:: get_height - - | :sl:`get the height of the Surface` - | :sg:`get_height() -> height` - - Return the height of the Surface in pixels. - - .. ## Surface.get_height ## - - .. method:: get_rect - - | :sl:`get the rectangular area of the Surface` - | :sg:`get_rect(**kwargs) -> Rect` - - Returns a new rectangle covering the entire surface. This rectangle will - always start at 0, 0 with a width. and height the same size as the image. - - You can pass keyword argument values to this function. These named values - will be applied to the attributes of the Rect before it is returned. An - example would be 'mysurf.get_rect(center=(100,100))' to create a - rectangle for the Surface centered at a given position. - - .. ## Surface.get_rect ## - - .. method:: get_bitsize - - | :sl:`get the bit depth of the Surface pixel format` - | :sg:`get_bitsize() -> int` - - Returns the number of bits used to represent each pixel. This value may - not exactly fill the number of bytes used per pixel. For example a 15 bit - Surface still requires a full 2 bytes. - - .. ## Surface.get_bitsize ## - - .. method:: get_bytesize - - | :sl:`get the bytes used per Surface pixel` - | :sg:`get_bytesize() -> int` - - Return the number of bytes used per pixel. - - .. ## Surface.get_bytesize ## - - .. method:: get_flags - - | :sl:`get the additional flags used for the Surface` - | :sg:`get_flags() -> int` - - Returns a set of current Surface features. Each feature is a bit in the - flags bitmask. Typical flags are ``HWSURFACE``, ``RLEACCEL``, - ``SRCALPHA``, and ``SRCCOLORKEY``. - - Here is a more complete list of flags. A full list can be found in - ``SDL_video.h`` - - :: - - SWSURFACE 0x00000000 # Surface is in system memory - HWSURFACE 0x00000001 # Surface is in video memory - ASYNCBLIT 0x00000004 # Use asynchronous blits if possible - - Available for ``pygame.display.set_mode()`` - - :: - - ANYFORMAT 0x10000000 # Allow any video depth/pixel-format - HWPALETTE 0x20000000 # Surface has exclusive palette - DOUBLEBUF 0x40000000 # Set up double-buffered video mode - FULLSCREEN 0x80000000 # Surface is a full screen display - OPENGL 0x00000002 # Create an OpenGL rendering context - OPENGLBLIT 0x0000000A # Create an OpenGL rendering context - # and use it for blitting. Obsolete. - RESIZABLE 0x00000010 # This video mode may be resized - NOFRAME 0x00000020 # No window caption or edge frame - - Used internally (read-only) - - :: - - HWACCEL 0x00000100 # Blit uses hardware acceleration - SRCCOLORKEY 0x00001000 # Blit uses a source color key - RLEACCELOK 0x00002000 # Private flag - RLEACCEL 0x00004000 # Surface is RLE encoded - SRCALPHA 0x00010000 # Blit uses source alpha blending - PREALLOC 0x01000000 # Surface uses preallocated memory - - .. ## Surface.get_flags ## - - .. method:: get_pitch - - | :sl:`get the number of bytes used per Surface row` - | :sg:`get_pitch() -> int` - - Return the number of bytes separating each row in the Surface. Surfaces - in video memory are not always linearly packed. Subsurfaces will also - have a larger pitch than their real width. - - This value is not needed for normal Pygame usage. - - .. ## Surface.get_pitch ## - - .. method:: get_masks - - | :sl:`the bitmasks needed to convert between a color and a mapped integer` - | :sg:`get_masks() -> (R, G, B, A)` - - Returns the bitmasks used to isolate each color in a mapped integer. - - This value is not needed for normal Pygame usage. - - .. ## Surface.get_masks ## - - .. method:: set_masks - - | :sl:`set the bitmasks needed to convert between a color and a mapped integer` - | :sg:`set_masks((r,g,b,a)) -> None` - - This is not needed for normal Pygame usage. New in pygame 1.8.1 - - .. ## Surface.set_masks ## - - .. method:: get_shifts - - | :sl:`the bit shifts needed to convert between a color and a mapped integer` - | :sg:`get_shifts() -> (R, G, B, A)` - - Returns the pixel shifts need to convert between each color and a mapped - integer. - - This value is not needed for normal Pygame usage. - - .. ## Surface.get_shifts ## - - .. method:: set_shifts - - | :sl:`sets the bit shifts needed to convert between a color and a mapped integer` - | :sg:`set_shifts((r,g,b,a)) -> None` - - This is not needed for normal Pygame usage. New in pygame 1.8.1 - - .. ## Surface.set_shifts ## - - .. method:: get_losses - - | :sl:`the significant bits used to convert between a color and a mapped integer` - | :sg:`get_losses() -> (R, G, B, A)` - - Return the least significant number of bits stripped from each color in a - mapped integer. - - This value is not needed for normal Pygame usage. - - .. ## Surface.get_losses ## - - .. method:: get_bounding_rect - - | :sl:`find the smallest rect containing data` - | :sg:`get_bounding_rect(min_alpha = 1) -> Rect` - - Returns the smallest rectangular region that contains all the pixels in - the surface that have an alpha value greater than or equal to the minimum - alpha value. - - This function will temporarily lock and unlock the Surface as needed. - - New in pygame 1.8. - - .. ## Surface.get_bounding_rect ## - - .. method:: get_view - - | :sl:`return a view of a surface's pixel data.` - | :sg:`get_view(kind='2') -> <view>` - - Return an object which exposes a surface's internal pixel buffer to a - NumPy array. For now a custom object with an array struct interface is - returned. A Python memoryview may be returned in the future. The buffer - is writeable. - - The kind argument is the length 1 string '2', '3', 'r', 'g', 'b', or 'a'. - The letters are case insensitive; 'A' will work as well. The argument can - be either a Unicode or byte (char) string. The default is '2'. - - A kind '2' view is a (surface-width, surface-height) array of raw pixels. - The pixels are surface bytesized unsigned integers. The pixel format is - surface specific. The 3 byte unsigned integers of 24 bit surfaces are - unlikely accepted by anything other than other Pygame functions. - - '3' returns a (surface-width, surface-height, 3) view of ``RGB`` color - components. Each of the red, green, and blue components are unsigned - bytes. Only 24-bit and 32-bit surfaces are supported. The color - components must be in either ``RGB`` or ``BGR`` order within the pixel. - - 'r' for red, 'g' for green, 'b' for blue, and 'a' for alpha return a - (surface-width, surface-height) view of a single color component within a - surface: a color plane. Color components are unsigned bytes. Both 24-bit - and 32-bit surfaces support 'r', 'g', and 'b'. Only 32-bit surfaces with - ``SRCALPHA`` support 'a'. - - This method implicitly locks the Surface. The lock will be released, once - the returned view object is deleted. - - New in pygame 1.9.2. - - .. ## Surface.get_view ## - - .. method:: get_buffer - - | :sl:`acquires a buffer object for the pixels of the Surface.` - | :sg:`get_buffer() -> BufferProxy` - - Return a buffer object for the pixels of the Surface. The buffer can be - used for direct pixel access and manipulation. - - This method implicitly locks the Surface. The lock will be released, once - the returned BufferProxy object is deleted. - - New in pygame 1.8. - - .. ## Surface.get_buffer ## - - .. ## pygame.Surface ##
--- a/docs/_sources/ref/surfarray.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.surfarray` -======================= - -.. module:: pygame.surfarray - :synopsis: pygame module for accessing surface pixel data using array interfaces - -| :sl:`pygame module for accessing surface pixel data using array interfaces` - -Functions to convert pixel data between pygame Surfaces and arrays. This module -will only be functional when pygame can use the external Numpy or Numeric -packages. - -Every pixel is stored as a single integer value to represent the red, green, -and blue colors. The 8bit images use a value that looks into a colormap. Pixels -with higher depth use a bit packing process to place three or four values into -a single number. - -The arrays are indexed by the ``X`` axis first, followed by the ``Y`` axis. -Arrays that treat the pixels as a single integer are referred to as 2D arrays. -This module can also separate the red, green, and blue color values into -separate indices. These types of arrays are referred to as 3D arrays, and the -last index is 0 for red, 1 for green, and 2 for blue. - -Supported array systems are - -:: - - numpy - numeric (deprecated; to be removed in Pygame 1.9.3.) - -The default will be numpy, if installed. Otherwise, Numeric will be set as -default if installed, and a deprecation warning will be issued. If neither -numpy nor Numeric are installed, the module will raise an ImportError. - -The array type to use can be changed at runtime using the use_arraytype () -method, which requires one of the above types as string. - -Note: numpy and Numeric are not completely compatible. Certain array -manipulations, which work for one type, might behave differently or even -completely break for the other. - -Additionally, in contrast to Numeric, numpy does use unsigned 16-bit integers. -Images with 16-bit data will be treated as unsigned integers. Numeric instead -uses signed integers for the representation, which is important to keep in -mind, if you use the module's functions and wonder about the values. - -The support of numpy is new in Pygame 1.8. Official Numeric deprecation begins -in Pygame 1.9.2. - -.. function:: array2d - - | :sl:`Copy pixels into a 2d array` - | :sg:`array2d(Surface) -> array` - - Copy the pixels from a Surface into a 2D array. The bit depth of the surface - will control the size of the integer values, and will work for any type of - pixel format. - - This function will temporarily lock the Surface as pixels are copied (see - the :func:`Surface.lock` - lock the Surface memory for pixel access method). - - .. ## pygame.surfarray.array2d ## - -.. function:: pixels2d - - | :sl:`Reference pixels into a 2d array` - | :sg:`pixels2d(Surface) -> array` - - Create a new 2D array that directly references the pixel values in a - Surface. Any changes to the array will affect the pixels in the Surface. - This is a fast operation since no data is copied. - - Pixels from a 24-bit Surface cannot be referenced, but all other Surface bit - depths can. - - The Surface this references will remain locked for the lifetime of the array - (see the :func:`Surface.lock` - lock the Surface memory for pixel access - method). - - .. ## pygame.surfarray.pixels2d ## - -.. function:: array3d - - | :sl:`Copy pixels into a 3d array` - | :sg:`array3d(Surface) -> array` - - Copy the pixels from a Surface into a 3D array. The bit depth of the surface - will control the size of the integer values, and will work for any type of - pixel format. - - This function will temporarily lock the Surface as pixels are copied (see - the :func:`Surface.lock` - lock the Surface memory for pixel access method). - - .. ## pygame.surfarray.array3d ## - -.. function:: pixels3d - - | :sl:`Reference pixels into a 3d array` - | :sg:`pixels3d(Surface) -> array` - - Create a new 3D array that directly references the pixel values in a - Surface. Any changes to the array will affect the pixels in the Surface. - This is a fast operation since no data is copied. - - This will only work on Surfaces that have 24-bit or 32-bit formats. Lower - pixel formats cannot be referenced. - - The Surface this references will remain locked for the lifetime of the array - (see the :func:`Surface.lock` - lock the Surface memory for pixel access - method). - - .. ## pygame.surfarray.pixels3d ## - -.. function:: array_alpha - - | :sl:`Copy pixel alphas into a 2d array` - | :sg:`array_alpha(Surface) -> array` - - Copy the pixel alpha values (degree of transparency) from a Surface into a - 2D array. This will work for any type of Surface format. Surfaces without a - pixel alpha will return an array with all opaque values. - - This function will temporarily lock the Surface as pixels are copied (see - the :func:`Surface.lock` - lock the Surface memory for pixel access method). - - .. ## pygame.surfarray.array_alpha ## - -.. function:: pixels_alpha - - | :sl:`Reference pixel alphas into a 2d array` - | :sg:`pixels_alpha(Surface) -> array` - - Create a new 2D array that directly references the alpha values (degree of - transparency) in a Surface. Any changes to the array will affect the pixels - in the Surface. This is a fast operation since no data is copied. - - This can only work on 32-bit Surfaces with a per-pixel alpha value. - - The Surface this array references will remain locked for the lifetime of the - array. - - .. ## pygame.surfarray.pixels_alpha ## - -.. function:: pixels_red - - | :sl:`Reference pixel red into a 2d array.` - | :sg:`pixels_red (Surface) -> array` - - Create a new 2D array that directly references the red values in a Surface. - Any changes to the array will affect the pixels in the Surface. This is a - fast operation since no data is copied. - - This can only work on 24-bit or 32-bit Surfaces. - - The Surface this array references will remain locked for the lifetime of the - array. - - .. ## pygame.surfarray.pixels_red ## - -.. function:: pixels_green - - | :sl:`Reference pixel green into a 2d array.` - | :sg:`pixels_green (Surface) -> array` - - Create a new 2D array that directly references the green values in a - Surface. Any changes to the array will affect the pixels in the Surface. - This is a fast operation since no data is copied. - - This can only work on 24-bit or 32-bit Surfaces. - - The Surface this array references will remain locked for the lifetime of the - array. - - .. ## pygame.surfarray.pixels_green ## - -.. function:: pixels_blue - - | :sl:`Reference pixel blue into a 2d array.` - | :sg:`pixels_blue (Surface) -> array` - - Create a new 2D array that directly references the blue values in a Surface. - Any changes to the array will affect the pixels in the Surface. This is a - fast operation since no data is copied. - - This can only work on 24-bit or 32-bit Surfaces. - - The Surface this array references will remain locked for the lifetime of the - array. - - .. ## pygame.surfarray.pixels_blue ## - -.. function:: array_colorkey - - | :sl:`Copy the colorkey values into a 2d array` - | :sg:`array_colorkey(Surface) -> array` - - Create a new array with the colorkey transparency value from each pixel. If - the pixel matches the colorkey it will be fully tranparent; otherwise it - will be fully opaque. - - This will work on any type of Surface format. If the image has no colorkey a - solid opaque array will be returned. - - This function will temporarily lock the Surface as pixels are copied. - - .. ## pygame.surfarray.array_colorkey ## - -.. function:: make_surface - - | :sl:`Copy an array to a new surface` - | :sg:`make_surface(array) -> Surface` - - Create a new Surface that best resembles the data and format on the array. - The array can be 2D or 3D with any sized integer values. Function - make_surface uses the array struct interface to aquire array properties, - so is not limited to just NumPy arrays. See :mod:`pygame.pixelcopy`. - - New in Pygame 1.9.2: array struct interface support. - - .. ## pygame.surfarray.make_surface ## - -.. function:: blit_array - - | :sl:`Blit directly from a array values` - | :sg:`blit_array(Surface, array) -> None` - - Directly copy values from an array into a Surface. This is faster than - converting the array into a Surface and blitting. The array must be the same - dimensions as the Surface and will completely replace all pixel values. Only - integer, ascii character and record arrays are accepted. - - This function will temporarily lock the Surface as the new values are - copied. - - .. ## pygame.surfarray.blit_array ## - -.. function:: map_array - - | :sl:`Map a 3d array into a 2d array` - | :sg:`map_array(Surface, array3d) -> array2d` - - Convert a 3D array into a 2D array. This will use the given Surface format - to control the conversion. Palette surface formats are supported for numpy - arrays. - - .. ## pygame.surfarray.map_array ## - -.. function:: use_arraytype - - | :sl:`Sets the array system to be used for surface arrays` - | :sg:`use_arraytype (arraytype) -> None` - - Uses the requested array type for the module functions. Currently supported - array types are: - - :: - - numeric (deprecated; will be removed in Pygame 1.9.3.) - numpy - - If the requested type is not available, a ValueError will be raised. - - New in pygame 1.8. - - .. ## pygame.surfarray.use_arraytype ## - -.. function:: get_arraytype - - | :sl:`Gets the currently active array type.` - | :sg:`get_arraytype () -> str` - - Returns the currently active array type. This will be a value of the - ``get_arraytypes()`` tuple and indicates which type of array module is used - for the array creation. - - New in pygame 1.8 - - .. ## pygame.surfarray.get_arraytype ## - -.. function:: get_arraytypes - - | :sl:`Gets the array system types currently supported.` - | :sg:`get_arraytypes () -> tuple` - - Checks, which array systems are available and returns them as a tuple of - strings. The values of the tuple can be used directly in the - :func:`pygame.surfarray.use_arraytype` () method. If no supported array - system could be found, None will be returned. - - New in pygame 1.8. - - .. ## pygame.surfarray.get_arraytypes ## - -.. ## pygame.surfarray ##
--- a/docs/_sources/ref/tests.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.tests` -=================== - -.. module:: pygame.tests - :synopsis: Pygame unit test suite package - -| :sl:`Pygame unit test suite package` - -A quick way to run the test suite package from the command line is to import -the go submodule with the Python -m option: - -:: - - python -m pygame.tests [<test options>] - -Command line option --help displays a usage message. Available options -correspond to the :func:`pygame.tests.run` arguments. - -The xxxx_test submodules of the tests package are unit test suites for -individual parts of Pygame. Each can also be run as a main program. This is -useful if the test, such as cdrom_test, is interactive. - -For Pygame development the test suite can be run from a Pygame distribution -root directory. Program ``run_tests.py`` is provided for convenience, though -test/go.py can be run directly. - -Module level tags control which modules are included in a unit test run. Tags -are assigned to a unit test module with a corresponding <<ame>_tags.py module. -The tags module has the global __tags__, a list of tag names. For example, -``cdrom_test.py`` has a tag file ``cdrom_tags.py`` containing a tags list that -has the 'interactive' string. The 'interactive' tag indicates ``cdrom_test.py`` -expects user input. It is excluded from a ``run_tests.py`` or -``pygame.tests.go`` run. Two other tags that are excluded are 'ignore' and -'subprocess_ignore'. These two tags indicate unit tests that will not run on a -particular platform, or for which no corresponding Pygame module is available. -The test runner will list each excluded module along with the tag responsible. - -.. function:: run - - | :sl:`Run the Pygame unit test suite` - | :sg:`run(*args, **kwds) -> tuple` - - Positional arguments (optional): - - :: - - The names of tests to include. If omitted then all tests are run. Test names - need not include the trailing '_test'. - - Keyword arguments: - - :: - - incomplete - fail incomplete tests (default False) - nosubprocess - run all test suites in the current process - (default False, use separate subprocesses) - dump - dump failures/errors as dict ready to eval (default False) - file - if provided, the name of a file into which to dump failures/errors - timings - if provided, the number of times to run each individual test to - get an average run time (default is run each test once) - exclude - A list of TAG names to exclude from the run - show_output - show silenced stderr/stdout on errors (default False) - all - dump all results, not just errors (default False) - randomize - randomize order of tests (default False) - seed - if provided, a seed randomizer integer - multi_thread - if provided, the number of THREADS in which to run - subprocessed tests - time_out - if subprocess is True then the time limit in seconds before - killing a test (default 30) - fake - if provided, the name of the fake tests package in the - run_tests__tests subpackage to run instead of the normal - Pygame tests - python - the path to a python executable to run subprocessed tests - (default sys.executable) - - Return value: - - :: - - A tuple of total number of tests run, dictionary of error information. - The dictionary is empty if no errors were recorded. - - By default individual test modules are run in separate subprocesses. This - recreates normal Pygame usage where ``pygame.init()`` and ``pygame.quit()`` - are called only once per program execution, and avoids unfortunate - interactions between test modules. Also, a time limit is placed on test - execution, so frozen tests are killed when there time allotment expired. Use - the single process option if threading is not working properly or if tests - are taking too long. It is not guaranteed that all tests will pass in single - process mode. - - Tests are run in a randomized order if the randomize argument is True or a - seed argument is provided. If no seed integer is provided then the system - time is used. - - Individual test modules may have a __tags__ attribute, a list of tag strings - used to selectively omit modules from a run. By default only 'interactive' - modules such as cdrom_test are ignored. An interactive module must be run - from the console as a Python program. - - This function can only be called once per Python session. It is not - reentrant. - - .. ## pygame.tests.run ## - -.. ## pygame.tests ##
--- a/docs/_sources/ref/time.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.time` -================== - -.. module:: pygame.time - :synopsis: pygame module for monitoring time - -| :sl:`pygame module for monitoring time` - -Times in pygame are represented in milliseconds (1/1000 seconds). Most -platforms have a limited time resolution of around 10 milliseconds. This -resolution, in milliseconds, is given in the ``TIMER_RESOLUTION`` constant. - -.. function:: get_ticks - - | :sl:`get the time in milliseconds` - | :sg:`get_ticks() -> milliseconds` - - Return the number of millisconds since ``pygame.init()`` was called. Before - pygame is initialized this will always be 0. - - .. ## pygame.time.get_ticks ## - -.. function:: wait - - | :sl:`pause the program for an amount of time` - | :sg:`wait(milliseconds) -> time` - - Will pause for a given number of milliseconds. This function sleeps the - process to share the processor with other programs. A program that waits for - even a few milliseconds will consume very little processor time. It is - slightly less accurate than the ``pygame.time.delay()`` function. - - This returns the actual number of milliseconds used. - - .. ## pygame.time.wait ## - -.. function:: delay - - | :sl:`pause the program for an amount of time` - | :sg:`delay(milliseconds) -> time` - - Will pause for a given number of milliseconds. This function will use the - processor (rather than sleeping) in order to make the delay more accurate - than ``pygame.time.wait()``. - - This returns the actual number of milliseconds used. - - .. ## pygame.time.delay ## - -.. function:: set_timer - - | :sl:`repeatedly create an event on the event queue` - | :sg:`set_timer(eventid, milliseconds) -> None` - - Set an event type to appear on the event queue every given number of - milliseconds. The first event will not appear until the amount of time has - passed. - - Every event type can have a separate timer attached to it. It is best to use - the value between ``pygame.USEREVENT`` and ``pygame.NUMEVENTS``. - - To disable the timer for an event, set the milliseconds argument to 0. - - .. ## pygame.time.set_timer ## - -.. class:: Clock - - | :sl:`create an object to help track time` - | :sg:`Clock() -> Clock` - - Creates a new Clock object that can be used to track an amount of time. The - clock also provides several functions to help control a game's framerate. - - .. method:: tick - - | :sl:`update the clock` - | :sg:`tick(framerate=0) -> milliseconds` - | :sg:` -> ` - - This method should be called once per frame. It will compute how many - milliseconds have passed since the previous call. - - If you pass the optional framerate argument the function will delay to - keep the game running slower than the given ticks per second. This can be - used to help limit the runtime speed of a game. By calling - ``Clock.tick(40)`` once per frame, the program will never run at more - than 40 frames per second. - - Note that this function uses SDL_Delay function which is not accurate on - every platform, but does not use much cpu. Use tick_busy_loop if you want - an accurate timer, and don't mind chewing cpu. - - .. ## Clock.tick ## - - .. method:: tick_busy_loop - - | :sl:`update the clock` - | :sg:`tick_busy_loop(framerate=0) -> milliseconds` - | :sg:` -> ` - - This method should be called once per frame. It will compute how many - milliseconds have passed since the previous call. - - If you pass the optional framerate argument the function will delay to - keep the game running slower than the given ticks per second. This can be - used to help limit the runtime speed of a game. By calling - ``Clock.tick_busy_loop(40)`` once per frame, the program will never run at - more than 40 frames per second. - - Note that this function uses :func:`pygame.time.delay`, which uses lots - of cpu in a busy loop to make sure that timing is more acurate. - - New in pygame 1.8.0. - - .. ## Clock.tick_busy_loop ## - - .. method:: get_time - - | :sl:`time used in the previous tick` - | :sg:`get_time() -> milliseconds` - - Returns the parameter passed to the last call to ``Clock.tick()``. It is - the number of milliseconds passed between the previous two calls to - ``Pygame.tick()``. - - .. ## Clock.get_time ## - - .. method:: get_rawtime - - | :sl:`actual time used in the previous tick` - | :sg:`get_rawtime() -> milliseconds` - - Similar to ``Clock.get_time()``, but this does not include any time used - while ``Clock.tick()`` was delaying to limit the framerate. - - .. ## Clock.get_rawtime ## - - .. method:: get_fps - - | :sl:`compute the clock framerate` - | :sg:`get_fps() -> float` - - Compute your game's framerate (in frames per second). It is computed by - averaging the last ten calls to ``Clock.tick()``. - - .. ## Clock.get_fps ## - - .. ## pygame.time.Clock ## - -.. ## pygame.time ##
--- a/docs/_sources/ref/transform.txt Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,234 +0,0 @@ -.. include:: common.txt - -:mod:`pygame.transform` -======================= - -.. module:: pygame.transform - :synopsis: pygame module to transform surfaces - -| :sl:`pygame module to transform surfaces` - -A Surface transform is an operation that moves or resizes the pixels. All these -functions take a Surface to operate on and return a new Surface with the -results. - -Some of the transforms are considered destructive. These means every time they -are performed they lose pixel data. Common examples of this are resizing and -rotating. For this reason, it is better to retransform the original surface -than to keep transforming an image multiple times. (For example, suppose you -are animating a bouncing spring which expands and contracts. If you applied the -size changes incrementally to the previous images, you would lose detail. -Instead, always begin with the original image and scale to the desired size.) - -.. function:: flip - - | :sl:`flip vertically and horizontally` - | :sg:`flip(Surface, xbool, ybool) -> Surface` - - This can flip a Surface either vertically, horizontally, or both. Flipping a - Surface is nondestructive and returns a new Surface with the same - dimensions. - - .. ## pygame.transform.flip ## - -.. function:: scale - - | :sl:`resize to new resolution` - | :sg:`scale(Surface, (width, height), DestSurface = None) -> Surface` - - Resizes the Surface to a new resolution. This is a fast scale operation that - does not sample the results. - - An optional destination surface can be used, rather than have it create a - new one. This is quicker if you want to repeatedly scale something. However - the destination must be the same size as the (width, height) passed in. Also - the destination surface must be the same format. - - .. ## pygame.transform.scale ## - -.. function:: rotate - - | :sl:`rotate an image` - | :sg:`rotate(Surface, angle) -> Surface` - - Unfiltered counterclockwise rotation. The angle argument represents degrees - and can be any floating point value. Negative angle amounts will rotate - clockwise. - - Unless rotating by 90 degree increments, the image will be padded larger to - hold the new size. If the image has pixel alphas, the padded area will be - transparent. Otherwise pygame will pick a color that matches the Surface - colorkey or the topleft pixel value. - - .. ## pygame.transform.rotate ## - -.. function:: rotozoom - - | :sl:`filtered scale and rotation` - | :sg:`rotozoom(Surface, angle, scale) -> Surface` - - This is a combined scale and rotation transform. The resulting Surface will - be a filtered 32-bit Surface. The scale argument is a floating point value - that will be multiplied by the current resolution. The angle argument is a - floating point value that represents the counterclockwise degrees to rotate. - A negative rotation angle will rotate clockwise. - - .. ## pygame.transform.rotozoom ## - -.. function:: scale2x - - | :sl:`specialized image doubler` - | :sg:`scale2x(Surface, DestSurface = None) -> Surface` - - This will return a new image that is double the size of the original. It - uses the AdvanceMAME Scale2X algorithm which does a 'jaggie-less' scale of - bitmap graphics. - - This really only has an effect on simple images with solid colors. On - photographic and antialiased images it will look like a regular unfiltered - scale. - - An optional destination surface can be used, rather than have it create a - new one. This is quicker if you want to repeatedly scale something. However - the destination must be twice the size of the source surface passed in. Also - the destination surface must be the same format. - - .. ## pygame.transform.scale2x ## - -.. function:: smoothscale - - | :sl:`scale a surface to an arbitrary size smoothly` - | :sg:`smoothscale(Surface, (width, height), DestSurface = None) -> Surface` - - Uses one of two different algorithms for scaling each dimension of the input - surface as required. For shrinkage, the output pixels are area averages of - the colors they cover. For expansion, a bilinear filter is used. For the - amd64 and i686 architectures, optimized ``MMX`` routines are included and - will run much faster than other machine types. The size is a 2 number - sequence for (width, height). This function only works for 24-bit or 32-bit - surfaces. An exception will be thrown if the input surface bit depth is less - than 24. - - New in pygame 1.8 - - .. ## pygame.transform.smoothscale ## - -.. function:: get_smoothscale_backend - - | :sl:`return smoothscale filter version in use: 'GENERIC', 'MMX', or 'SSE'` - | :sg:`get_smoothscale_backend() -> String` - - Shows whether or not smoothscale is using ``MMX`` or ``SSE`` acceleration. - If no acceleration is available then "GENERIC" is returned. For a x86 - processor the level of acceleration to use is determined at runtime. - - This function is provided for Pygame testing and debugging. - - .. ## pygame.transform.get_smoothscale_backend ## - -.. function:: set_smoothscale_backend - - | :sl:`set smoothscale filter version to one of: 'GENERIC', 'MMX', or 'SSE'` - | :sg:`set_smoothscale_backend(type) -> None` - - Sets smoothscale acceleration. Takes a string argument. A value of 'GENERIC' - turns off acceleration. 'MMX' uses ``MMX`` instructions only. 'SSE' allows - ``SSE`` extensions as well. A value error is raised if type is not - recognized or not supported by the current processor. - - This function is provided for Pygame testing and debugging. If smoothscale - causes an invalid instruction error then it is a Pygame/SDL bug that should - be reported. Use this function as a temporary fix only. - - .. ## pygame.transform.set_smoothscale_backend ## - -.. function:: chop - - | :sl:`gets a copy of an image with an interior area removed` - | :sg:`chop(Surface, rect) -> Surface` - - Extracts a portion of an image. All vertical and horizontal pixels - surrounding the given rectangle area are removed. The corner areas (diagonal - to the rect) are then brought together. (The original image is not altered - by this operation.) - - ``NOTE``: If you want a "crop" that returns the part of an image within a - rect, you can blit with a rect to a new surface or copy a subsurface. - - .. ## pygame.transform.chop ## - -.. function:: laplacian - - | :sl:`find edges in a surface` - | :sg:`laplacian(Surface, DestSurface = None) -> Surface` - - Finds the edges in a surface using the laplacian algorithm. - - New in pygame 1.8 - - .. ## pygame.transform.laplacian ## - -.. function:: average_surfaces - - | :sl:`find the average surface from many surfaces.` - | :sg:`average_surfaces(Surfaces, DestSurface = None, palette_colors = 1) -> Surface` - - Takes a sequence of surfaces and returns a surface with average colors from - each of the surfaces. - - palette_colors - if true we average the colors in palette, otherwise we - average the pixel values. This is useful if the surface is actually - greyscale colors, and not palette colors. - - Note, this function currently does not handle palette using surfaces - correctly. - - New in pygame 1.8 palette_colors argument new in pygame 1.9 - - .. ## pygame.transform.average_surfaces ## - -.. function:: average_color - - | :sl:`finds the average color of a surface` - | :sg:`average_color(Surface, Rect = None) -> Color` - - Finds the average color of a Surface or a region of a surface specified by a - Rect, and returns it as a Color. - - .. ## pygame.transform.average_color ## - -.. function:: threshold - - | :sl:`finds which, and how many pixels in a surface are within a threshold of a color.` - | :sg:`threshold(DestSurface, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = 1, Surface = None, inverse = False) -> num_threshold_pixels` - - Finds which, and how many pixels in a surface are within a threshold of a - color. - - It can set the destination surface where all of the pixels not within the - threshold are changed to diff_color. If inverse is optionally set to True, - the pixels that are within the threshold are instead changed to diff_color. - - If the optional second surface is given, it is used to threshold against - rather than the specified color. That is, it will find each pixel in the - first Surface that is within the threshold of the pixel at the same - coordinates of the second Surface. - - If change_return is set to 0, it can be used to just count the number of - pixels within the threshold if you set - - If change_return is set to 1, the pixels set in DestSurface will be those - from the color. - - If change_return is set to 2, the pixels set in DestSurface will be those - from the first Surface. - - You can use a threshold of (r,g,b,a) where the r,g,b can have different - thresholds. So you could use an r threshold of 40 and a blue threshold of 2 - if you like. - - New in pygame 1.8 - - .. ## pygame.transform.threshold ## - -.. ## pygame.transform ##
--- a/docs/_static/basic.css Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,509 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -img { - border: 0; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -.align-left { - text-align: left; -} - -.align-center { - clear: both; - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.refcount { - color: #060; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -}
--- a/docs/_static/doctools.js Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilties for all documentation. - * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -} - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * small function to check if an array contains - * a given item. - */ -jQuery.contains = function(arr, item) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == item) - return true; - } - return false; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('<a class="headerlink">\u00B6</a>'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('<a class="headerlink">\u00B6</a>'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('<li class="highlight-link"><a href="javascript:Documentation.' + - 'hideSearchWords()">' + _('Hide Search Matches') + '</a></li>') - .appendTo($('.sidebar .this-page-menu')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -});
--- a/docs/_static/jquery.js Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.2 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Sat Feb 13 22:33:48 2010 -0500 - */ -(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i? -e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r= -j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g, -"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e= -true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, -Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& -(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, -a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== -"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, -function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)|| -c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded", -L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype, -"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+ -a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f], -d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]=== -a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&& -!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari= -true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; -var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, -parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= -false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= -s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, -applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; -else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, -a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== -w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, -cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", -i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ", -" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className= -this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= -e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= -c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); -a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, -function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); -k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), -C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!= -null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type= -e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& -f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; -if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), -fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| -d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this, -"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= -a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y, -isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= -{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; -if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", -e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, -"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, -d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&& -!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}}, -toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, -u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), -function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q]; -if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); -t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| -g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[]; -for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length- -1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, -CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}}, -relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]= -l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[]; -h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m= -m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition|| -!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m= -h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, -gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length; -c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? -a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& -this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]|| -u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length=== -1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== -"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, -serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), -function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, -global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& -e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? -"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== -false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= -false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", -c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| -d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); -g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== -1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== -"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; -if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay"); -this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a], -"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)}, -animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing= -j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]); -this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== -"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| -c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; -this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= -this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, -e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length|| -c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement? -function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b= -this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle; -k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&& -f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; -a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); -c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, -d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- -f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": -"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in -e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
--- a/docs/_static/pygame.css Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,571 +0,0 @@ -/** - * Pygame stylesheet -- original theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -@import url("reset.css"); -@import url("tooltip.css"); - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -#pygame-front-page dt { - padding-top: 1em; -} - -#pygame-front-page dl { - padding: 0 0 0 1em; -} - -#pygame-front-page h2 { - padding: 1em 0 0 0; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: serif; - color: #000000; - font-style: normal; - text-decoration: none; - text-align: left; - border-style: none; -} - -div.header { - padding: 0.5em; - background-color: #aaeebb; - color: ; - line-height: 1.2em; -} - -div.header table { - border: 3px solid black; - border-collapse: collapse; - background-color: #6aee28; -} - -div.header td { - border-right: 3px solid black; -} - -div.header .logo { - background-color: #c2fc20; - text-align: center; - vertical-align: middle; - padding: 0.3em; -} - -div.header .logo img { - min-width: 200px; - min-height: 60px; - border-style: none; -} - -div.header .logo strong { - weight: bold; -} - -dev.header .logo a { - visibility: hidden; -} - -div.header .pagelinks { - padding: 0.3em; - text-align: center; - vertical-align: middle; -} - -div.header p.top { - margin-top: 0; -} - -div.header p.bottom { - margin-bottom: 0; -} - -div.header .pagelinks a { - text-decoration: underline; -} - -div.header .pagelinks a:hover { - text-decoration: none; -} - -div.document { - background-color: #aaeebb; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { -} - -div.heading { - padding: 0 0 0 0.5em; -} - -div.sectionwrapper { - padding: 0 2em 1em 0.5em; -} - -div.footer { - display: none; - color: #000000; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - background-color: #11303d - color: #000000; - text-decoration: underline; -} - -div.related { - background-color: #6aee28; - line-height: 30px; - color: #000000; - border-top: 3px solid black; - border-bottom: 3px solid black; -} - -div.related a { - color: #000000; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #000000; - background-color: transparent; - text-decoration: underline; -} - -a:hover { - color: #000000; - background-color: transparent; - text-decoration: none; -} - -p { - margin-top: 1em; -} - -dl { - padding-top: 2em; -} - -dd { - margin-left: 30px; -} - -dt tt { - font-weight: bold; - font-size: 1.1em; -} - -dt.module { - margin-bottom: 1em; -} - -table.toc { - margin-left: 2em; -} - -table.toc td { - border-style: none; - padding-right: 10px; -} - -dt.module { - margin-bottom: 1em; -} - -span.summaryline { - font-style: italic; -} - -span.signature { - font-family: monospace; -} - -table.docutils td.toc { - border-style: none; -} - -dl.class em.property { -/* display: none;*/ -} - -dl.argsig tt.descclassname { -/* display: none;*/ -} - -div.body p, div.body dd, div.body li { - text-align: left; - line-height: 130%; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: serif; - font-weight: bold; - margin: 12.5% 0 12.5% 0 - padding: 12.5% 0 12.5% 0; - text-align: left; -} - -div.body h6 { - font-weight: normal; - font-style: italic; - margin: 0; - padding: 0; - line-height: 130%; -} - -div.body h1 { font-size: 1.5em; } -div.body h2 { font-size: 1.4em; } -div.body h3 { font-size: 1.3em; } -div.body h4 { font-size: 1.2em; } -div.body h5 { font-size: 1.1em; } -div.body h6 { font-size: 1.0em; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -a.headerlink { - visibility: hidden; -} - -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p, div.body dd, div.body li { - text-align: left; - line-height: 130%; -} - -blockquote { - margin-left: 2em; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -p.linklist { - text-align: center; -} - -pre { - font-family: monospace; - padding: 5px; - margin-left: 30px; - margin-bottom: 1em; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -ul.simple { - list-style-type: circle; - list-style-position: inside; - margin-bottom: 1em; -} - -/* -- tooltip style --------------------------------------------------------- */ - -a.tooltip { - text-decoration: underline; -} - -a.tooltip:hover { - text-decoration: none; -} - -.tooltip-content { - width: 250px; - background-color: #c2fc20; - border: 1px solid #ace01C; - padding: 3px; - border-radius: 5px 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); - -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -} - - - -/* -- comments style --------------------------------------------------------- */ - -form.addcomment { - display:inline; -} -.addcomment input, -a.commentButton { - background-color: #6AEE28; - border: 1px solid #000000; - color: #000000; - font-family: Arial,Helvetica,sans-serif; - font-size: 12px; - font-weight: bold; - padding: 6px; - margin-right: 4px; -} - -article.commentsArticle { - background: none repeat scroll 0 0 #FEF790; - border: 1px solid black; - margin-bottom: 12px; - margin-top: 12px; - padding: 4px; - -} - -article.hidden { - display:none; -} - -section.commentPart { -} - -header.commentHeading { - background: none repeat scroll 0 0 #FDE42D; - text-align: center; -} -pre.commentContent { - overflow: auto; - max-width; 800px; - margin-left:0px; - border: 0; -} -
--- a/docs/_static/pygments.css Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -.highlight .hll { background-color: #ffffcc } -.highlight { background: #eeffcc; } -.highlight .c { color: #408090; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #007020; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #007020 } /* Comment.Preproc */ -.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #303030 } /* Generic.Output */ -.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #007020 } /* Keyword.Pseudo */ -.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #902000 } /* Keyword.Type */ -.highlight .m { color: #208050 } /* Literal.Number */ -.highlight .s { color: #4070a0 } /* Literal.String */ -.highlight .na { color: #4070a0 } /* Name.Attribute */ -.highlight .nb { color: #007020 } /* Name.Builtin */ -.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.highlight .no { color: #60add5 } /* Name.Constant */ -.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #007020 } /* Name.Exception */ -.highlight .nf { color: #06287e } /* Name.Function */ -.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ -.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #bb60d5 } /* Name.Variable */ -.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #208050 } /* Literal.Number.Float */ -.highlight .mh { color: #208050 } /* Literal.Number.Hex */ -.highlight .mi { color: #208050 } /* Literal.Number.Integer */ -.highlight .mo { color: #208050 } /* Literal.Number.Oct */ -.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ -.highlight .sc { color: #4070a0 } /* Literal.String.Char */ -.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ -.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ -.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.highlight .sx { color: #c65d09 } /* Literal.String.Other */ -.highlight .sr { color: #235388 } /* Literal.String.Regex */ -.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ -.highlight .ss { color: #517918 } /* Literal.String.Symbol */ -.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ -.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ -.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ -.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file
--- a/docs/_static/reset.css Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* Set browser to a known state to get around browser incompatibilities. - * Copied from http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ - */ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, font, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-weight: inherit; - font-style: inherit; - font-size: 100%; - font-family: inherit; - vertical-align: baseline; -} -/* remember to define focus styles! */ -:focus { - outline: 0; -} -body { - line-height: 1; - color: black; - background: white; -} -ol, ul { - list-style: none; -} -/* tables still need 'cellspacing="0"' in the markup */ -table { - border-collapse: separate; - border-spacing: 0; -} -caption, th, td { - text-align: left; - font-weight: normal; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ""; -} -blockquote, q { - quotes: "" ""; -}
--- a/docs/_static/searchtools.js Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,518 +0,0 @@ -/* - * searchtools.js - * ~~~~~~~~~~~~~~ - * - * Sphinx JavaScript utilties for the full-text search. - * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * helper function to return a node containing the - * search summary for a given text. keywords is a list - * of stemmed words, hlwords is the list of normal, unstemmed - * words. the first one is used to find the occurance, the - * latter for highlighting it. - */ - -jQuery.makeSearchSummary = function(text, keywords, hlwords) { - var textLower = text.toLowerCase(); - var start = 0; - $.each(keywords, function() { - var i = textLower.indexOf(this.toLowerCase()); - if (i > -1) - start = i; - }); - start = Math.max(start - 120, 0); - var excerpt = ((start > 0) ? '...' : '') + - $.trim(text.substr(start, 240)) + - ((start + 240 - text.length) ? '...' : ''); - var rv = $('<div class="context"></div>').text(excerpt); - $.each(hlwords, function() { - rv = rv.highlightText(this, 'highlighted'); - }); - return rv; -} - -/** - * Porter Stemmer - */ -var PorterStemmer = function() { - - var step2list = { - ational: 'ate', - tional: 'tion', - enci: 'ence', - anci: 'ance', - izer: 'ize', - bli: 'ble', - alli: 'al', - entli: 'ent', - eli: 'e', - ousli: 'ous', - ization: 'ize', - ation: 'ate', - ator: 'ate', - alism: 'al', - iveness: 'ive', - fulness: 'ful', - ousness: 'ous', - aliti: 'al', - iviti: 'ive', - biliti: 'ble', - logi: 'log' - }; - - var step3list = { - icate: 'ic', - ative: '', - alize: 'al', - iciti: 'ic', - ical: 'ic', - ful: '', - ness: '' - }; - - var c = "[^aeiou]"; // consonant - var v = "[aeiouy]"; // vowel - var C = c + "[^aeiouy]*"; // consonant sequence - var V = v + "[aeiou]*"; // vowel sequence - - var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 - var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 - var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 - var s_v = "^(" + C + ")?" + v; // vowel in stem - - this.stemWord = function (w) { - var stem; - var suffix; - var firstch; - var origword = w; - - if (w.length < 3) - return w; - - var re; - var re2; - var re3; - var re4; - - firstch = w.substr(0,1); - if (firstch == "y") - w = firstch.toUpperCase() + w.substr(1); - - // Step 1a - re = /^(.+?)(ss|i)es$/; - re2 = /^(.+?)([^s])s$/; - - if (re.test(w)) - w = w.replace(re,"$1$2"); - else if (re2.test(w)) - w = w.replace(re2,"$1$2"); - - // Step 1b - re = /^(.+?)eed$/; - re2 = /^(.+?)(ed|ing)$/; - if (re.test(w)) { - var fp = re.exec(w); - re = new RegExp(mgr0); - if (re.test(fp[1])) { - re = /.$/; - w = w.replace(re,""); - } - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1]; - re2 = new RegExp(s_v); - if (re2.test(stem)) { - w = stem; - re2 = /(at|bl|iz)$/; - re3 = new RegExp("([^aeiouylsz])\\1$"); - re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) - w = w + "e"; - else if (re3.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - else if (re4.test(w)) - w = w + "e"; - } - } - - // Step 1c - re = /^(.+?)y$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(s_v); - if (re.test(stem)) - w = stem + "i"; - } - - // Step 2 - re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step2list[suffix]; - } - - // Step 3 - re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step3list[suffix]; - } - - // Step 4 - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - re2 = /^(.+?)(s|t)(ion)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - if (re.test(stem)) - w = stem; - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1] + fp[2]; - re2 = new RegExp(mgr1); - if (re2.test(stem)) - w = stem; - } - - // Step 5 - re = /^(.+?)e$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - re2 = new RegExp(meq1); - re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) - w = stem; - } - re = /ll$/; - re2 = new RegExp(mgr1); - if (re.test(w) && re2.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - - // and turn initial Y back to y - if (firstch == "y") - w = firstch.toLowerCase() + w.substr(1); - return w; - } -} - - -/** - * Search Module - */ -var Search = { - - _index : null, - _queued_query : null, - _pulse_status : -1, - - init : function() { - var params = $.getQueryParameters(); - if (params.q) { - var query = params.q[0]; - $('input[name="q"]')[0].value = query; - this.performSearch(query); - } - }, - - loadIndex : function(url) { - $.ajax({type: "GET", url: url, data: null, success: null, - dataType: "script", cache: true}); - }, - - setIndex : function(index) { - var q; - this._index = index; - if ((q = this._queued_query) !== null) { - this._queued_query = null; - Search.query(q); - } - }, - - hasIndex : function() { - return this._index !== null; - }, - - deferQuery : function(query) { - this._queued_query = query; - }, - - stopPulse : function() { - this._pulse_status = 0; - }, - - startPulse : function() { - if (this._pulse_status >= 0) - return; - function pulse() { - Search._pulse_status = (Search._pulse_status + 1) % 4; - var dotString = ''; - for (var i = 0; i < Search._pulse_status; i++) - dotString += '.'; - Search.dots.text(dotString); - if (Search._pulse_status > -1) - window.setTimeout(pulse, 500); - }; - pulse(); - }, - - /** - * perform a search for something - */ - performSearch : function(query) { - // create the required interface elements - this.out = $('#search-results'); - this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out); - this.dots = $('<span></span>').appendTo(this.title); - this.status = $('<p style="display: none"></p>').appendTo(this.out); - this.output = $('<ul class="search"/>').appendTo(this.out); - - $('#search-progress').text(_('Preparing search...')); - this.startPulse(); - - // index already loaded, the browser was quick! - if (this.hasIndex()) - this.query(query); - else - this.deferQuery(query); - }, - - query : function(query) { - var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in', - 'if', 'for', 'no', 'there', 'their', 'was', 'is', - 'be', 'to', 'that', 'but', 'they', 'not', 'such', - 'with', 'by', 'a', 'on', 'these', 'of', 'will', - 'this', 'near', 'the', 'or', 'at']; - - // stem the searchterms and add them to the correct list - var stemmer = new PorterStemmer(); - var searchterms = []; - var excluded = []; - var hlterms = []; - var tmp = query.split(/\s+/); - var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null; - for (var i = 0; i < tmp.length; i++) { - if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) || - tmp[i] == "") { - // skip this "word" - continue; - } - // stem the word - var word = stemmer.stemWord(tmp[i]).toLowerCase(); - // select the correct list - if (word[0] == '-') { - var toAppend = excluded; - word = word.substr(1); - } - else { - var toAppend = searchterms; - hlterms.push(tmp[i].toLowerCase()); - } - // only add if not already in the list - if (!$.contains(toAppend, word)) - toAppend.push(word); - }; - var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" ")); - - // console.debug('SEARCH: searching for:'); - // console.info('required: ', searchterms); - // console.info('excluded: ', excluded); - - // prepare search - var filenames = this._index.filenames; - var titles = this._index.titles; - var terms = this._index.terms; - var objects = this._index.objects; - var objtypes = this._index.objtypes; - var objnames = this._index.objnames; - var fileMap = {}; - var files = null; - // different result priorities - var importantResults = []; - var objectResults = []; - var regularResults = []; - var unimportantResults = []; - $('#search-progress').empty(); - - // lookup as object - if (object != null) { - for (var prefix in objects) { - for (var name in objects[prefix]) { - var fullname = (prefix ? prefix + '.' : '') + name; - if (fullname.toLowerCase().indexOf(object) > -1) { - match = objects[prefix][name]; - descr = objnames[match[1]] + _(', in ') + titles[match[0]]; - // XXX the generated anchors are not generally correct - // XXX there may be custom prefixes - result = [filenames[match[0]], fullname, '#'+fullname, descr]; - switch (match[2]) { - case 1: objectResults.push(result); break; - case 0: importantResults.push(result); break; - case 2: unimportantResults.push(result); break; - } - } - } - } - } - - // sort results descending - objectResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - importantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - unimportantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - - // perform the search on the required terms - for (var i = 0; i < searchterms.length; i++) { - var word = searchterms[i]; - // no match but word was a required one - if ((files = terms[word]) == null) - break; - if (files.length == undefined) { - files = [files]; - } - // create the mapping - for (var j = 0; j < files.length; j++) { - var file = files[j]; - if (file in fileMap) - fileMap[file].push(word); - else - fileMap[file] = [word]; - } - } - - // now check if the files don't contain excluded terms - for (var file in fileMap) { - var valid = true; - - // check if all requirements are matched - if (fileMap[file].length != searchterms.length) - continue; - - // ensure that none of the excluded terms is in the - // search result. - for (var i = 0; i < excluded.length; i++) { - if (terms[excluded[i]] == file || - $.contains(terms[excluded[i]] || [], file)) { - valid = false; - break; - } - } - - // if we have still a valid result we can add it - // to the result list - if (valid) - regularResults.push([filenames[file], titles[file], '', null]); - } - - // delete unused variables in order to not waste - // memory until list is retrieved completely - delete filenames, titles, terms; - - // now sort the regular results descending by title - regularResults.sort(function(a, b) { - var left = a[1].toLowerCase(); - var right = b[1].toLowerCase(); - return (left > right) ? -1 : ((left < right) ? 1 : 0); - }); - - // combine all results - var results = unimportantResults.concat(regularResults) - .concat(objectResults).concat(importantResults); - - // print the results - var resultCount = results.length; - function displayNextItem() { - // results left, load the summary and display it - if (results.length) { - var item = results.pop(); - var listItem = $('<li style="display:none"></li>'); - if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') { - // dirhtml builder - var dirname = item[0] + '/'; - if (dirname.match(/\/index\/$/)) { - dirname = dirname.substring(0, dirname.length-6); - } else if (dirname == 'index/') { - dirname = ''; - } - listItem.append($('<a/>').attr('href', - DOCUMENTATION_OPTIONS.URL_ROOT + dirname + - highlightstring + item[2]).html(item[1])); - } else { - // normal html builders - listItem.append($('<a/>').attr('href', - item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX + - highlightstring + item[2]).html(item[1])); - } - if (item[3]) { - listItem.append($('<span> (' + item[3] + ')</span>')); - Search.output.append(listItem); - listItem.slideDown(5, function() { - displayNextItem(); - }); - } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { - $.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + - item[0] + '.txt', function(data) { - if (data != '') { - listItem.append($.makeSearchSummary(data, searchterms, hlterms)); - Search.output.append(listItem); - } - listItem.slideDown(5, function() { - displayNextItem(); - }); - }); - } else { - // no source available, just display title - Search.output.append(listItem); - listItem.slideDown(5, function() { - displayNextItem(); - }); - } - } - // search finished, update title and status message - else { - Search.stopPulse(); - Search.title.text(_('Search Results')); - if (!resultCount) - Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.')); - else - Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount)); - Search.status.fadeIn(500); - } - } - displayNextItem(); - } -} - -$(document).ready(function() { - Search.init(); -});
--- a/docs/_static/tooltip.css Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* Implement hyperlink tooltips - * - * Adapted from "Sexy Tooltips with Just CSS" - * http://sixrevisions.com/css/css-only-tooltips/ - */ - -.tooltip { - cursor: help; text-decoration: none; - position: relative; -} - -.tooltip span.tooltip-content { - margin-left: -999em; - position: absolute; -} - -.tooltip:hover span.tooltip-content { - position: absolute; - left: 1em; - top: 2em; - z-index: 99; - margin-left: 0; -} - -.tooltip:hover img { - border: 0; - margin: -10px 0 0 -55px; - float: left; - position: absolute; -} - -.tooltip:hover em { - font-family: Candara, Tahoma, Geneva, sans-serif; - font-size: 1.2em; - font-weight: bold; - display: block; - padding: 0.2em 0 0.6em 0; -} - -.classic { padding: 0.8em 1em; } - -.custom { padding: 0.5em 0.8em 0.8em 2em; } - -* html a:hover { background: transparent; }
--- a/docs/_static/underscore.js Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d, -a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c); -var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c, -d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck= -function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a, -function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a, -0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d, -e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d= -a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)}); -return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length); -var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false; -if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length== -0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&& -a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g, -" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments); -o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})();
--- a/docs/_static/websupport.js Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,808 +0,0 @@ -/* - * websupport.js - * ~~~~~~~~~~~~~ - * - * sphinx.websupport utilties for all documentation. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -(function($) { - $.fn.autogrow = function() { - return this.each(function() { - var textarea = this; - - $.fn.autogrow.resize(textarea); - - $(textarea) - .focus(function() { - textarea.interval = setInterval(function() { - $.fn.autogrow.resize(textarea); - }, 500); - }) - .blur(function() { - clearInterval(textarea.interval); - }); - }); - }; - - $.fn.autogrow.resize = function(textarea) { - var lineHeight = parseInt($(textarea).css('line-height'), 10); - var lines = textarea.value.split('\n'); - var columns = textarea.cols; - var lineCount = 0; - $.each(lines, function() { - lineCount += Math.ceil(this.length / columns) || 1; - }); - var height = lineHeight * (lineCount + 1); - $(textarea).css('height', height); - }; -})(jQuery); - -(function($) { - var comp, by; - - function init() { - initEvents(); - initComparator(); - } - - function initEvents() { - $('a.comment-close').live("click", function(event) { - event.preventDefault(); - hide($(this).attr('id').substring(2)); - }); - $('a.vote').live("click", function(event) { - event.preventDefault(); - handleVote($(this)); - }); - $('a.reply').live("click", function(event) { - event.preventDefault(); - openReply($(this).attr('id').substring(2)); - }); - $('a.close-reply').live("click", function(event) { - event.preventDefault(); - closeReply($(this).attr('id').substring(2)); - }); - $('a.sort-option').live("click", function(event) { - event.preventDefault(); - handleReSort($(this)); - }); - $('a.show-proposal').live("click", function(event) { - event.preventDefault(); - showProposal($(this).attr('id').substring(2)); - }); - $('a.hide-proposal').live("click", function(event) { - event.preventDefault(); - hideProposal($(this).attr('id').substring(2)); - }); - $('a.show-propose-change').live("click", function(event) { - event.preventDefault(); - showProposeChange($(this).attr('id').substring(2)); - }); - $('a.hide-propose-change').live("click", function(event) { - event.preventDefault(); - hideProposeChange($(this).attr('id').substring(2)); - }); - $('a.accept-comment').live("click", function(event) { - event.preventDefault(); - acceptComment($(this).attr('id').substring(2)); - }); - $('a.delete-comment').live("click", function(event) { - event.preventDefault(); - deleteComment($(this).attr('id').substring(2)); - }); - $('a.comment-markup').live("click", function(event) { - event.preventDefault(); - toggleCommentMarkupBox($(this).attr('id').substring(2)); - }); - } - - /** - * Set comp, which is a comparator function used for sorting and - * inserting comments into the list. - */ - function setComparator() { - // If the first three letters are "asc", sort in ascending order - // and remove the prefix. - if (by.substring(0,3) == 'asc') { - var i = by.substring(3); - comp = function(a, b) { return a[i] - b[i]; }; - } else { - // Otherwise sort in descending order. - comp = function(a, b) { return b[by] - a[by]; }; - } - - // Reset link styles and format the selected sort option. - $('a.sel').attr('href', '#').removeClass('sel'); - $('a.by' + by).removeAttr('href').addClass('sel'); - } - - /** - * Create a comp function. If the user has preferences stored in - * the sortBy cookie, use those, otherwise use the default. - */ - function initComparator() { - by = 'rating'; // Default to sort by rating. - // If the sortBy cookie is set, use that instead. - if (document.cookie.length > 0) { - var start = document.cookie.indexOf('sortBy='); - if (start != -1) { - start = start + 7; - var end = document.cookie.indexOf(";", start); - if (end == -1) { - end = document.cookie.length; - by = unescape(document.cookie.substring(start, end)); - } - } - } - setComparator(); - } - - /** - * Show a comment div. - */ - function show(id) { - $('#ao' + id).hide(); - $('#ah' + id).show(); - var context = $.extend({id: id}, opts); - var popup = $(renderTemplate(popupTemplate, context)).hide(); - popup.find('textarea[name="proposal"]').hide(); - popup.find('a.by' + by).addClass('sel'); - var form = popup.find('#cf' + id); - form.submit(function(event) { - event.preventDefault(); - addComment(form); - }); - $('#s' + id).after(popup); - popup.slideDown('fast', function() { - getComments(id); - }); - } - - /** - * Hide a comment div. - */ - function hide(id) { - $('#ah' + id).hide(); - $('#ao' + id).show(); - var div = $('#sc' + id); - div.slideUp('fast', function() { - div.remove(); - }); - } - - /** - * Perform an ajax request to get comments for a node - * and insert the comments into the comments tree. - */ - function getComments(id) { - $.ajax({ - type: 'GET', - url: opts.getCommentsURL, - data: {node: id}, - success: function(data, textStatus, request) { - var ul = $('#cl' + id); - var speed = 100; - $('#cf' + id) - .find('textarea[name="proposal"]') - .data('source', data.source); - - if (data.comments.length === 0) { - ul.html('<li>No comments yet.</li>'); - ul.data('empty', true); - } else { - // If there are comments, sort them and put them in the list. - var comments = sortComments(data.comments); - speed = data.comments.length * 100; - appendComments(comments, ul); - ul.data('empty', false); - } - $('#cn' + id).slideUp(speed + 200); - ul.slideDown(speed); - }, - error: function(request, textStatus, error) { - showError('Oops, there was a problem retrieving the comments.'); - }, - dataType: 'json' - }); - } - - /** - * Add a comment via ajax and insert the comment into the comment tree. - */ - function addComment(form) { - var node_id = form.find('input[name="node"]').val(); - var parent_id = form.find('input[name="parent"]').val(); - var text = form.find('textarea[name="comment"]').val(); - var proposal = form.find('textarea[name="proposal"]').val(); - - if (text == '') { - showError('Please enter a comment.'); - return; - } - - // Disable the form that is being submitted. - form.find('textarea,input').attr('disabled', 'disabled'); - - // Send the comment to the server. - $.ajax({ - type: "POST", - url: opts.addCommentURL, - dataType: 'json', - data: { - node: node_id, - parent: parent_id, - text: text, - proposal: proposal - }, - success: function(data, textStatus, error) { - // Reset the form. - if (node_id) { - hideProposeChange(node_id); - } - form.find('textarea') - .val('') - .add(form.find('input')) - .removeAttr('disabled'); - var ul = $('#cl' + (node_id || parent_id)); - if (ul.data('empty')) { - $(ul).empty(); - ul.data('empty', false); - } - insertComment(data.comment); - var ao = $('#ao' + node_id); - ao.find('img').attr({'src': opts.commentBrightImage}); - if (node_id) { - // if this was a "root" comment, remove the commenting box - // (the user can get it back by reopening the comment popup) - $('#ca' + node_id).slideUp(); - } - }, - error: function(request, textStatus, error) { - form.find('textarea,input').removeAttr('disabled'); - showError('Oops, there was a problem adding the comment.'); - } - }); - } - - /** - * Recursively append comments to the main comment list and children - * lists, creating the comment tree. - */ - function appendComments(comments, ul) { - $.each(comments, function() { - var div = createCommentDiv(this); - ul.append($(document.createElement('li')).html(div)); - appendComments(this.children, div.find('ul.comment-children')); - // To avoid stagnating data, don't store the comments children in data. - this.children = null; - div.data('comment', this); - }); - } - - /** - * After adding a new comment, it must be inserted in the correct - * location in the comment tree. - */ - function insertComment(comment) { - var div = createCommentDiv(comment); - - // To avoid stagnating data, don't store the comments children in data. - comment.children = null; - div.data('comment', comment); - - var ul = $('#cl' + (comment.node || comment.parent)); - var siblings = getChildren(ul); - - var li = $(document.createElement('li')); - li.hide(); - - // Determine where in the parents children list to insert this comment. - for(i=0; i < siblings.length; i++) { - if (comp(comment, siblings[i]) <= 0) { - $('#cd' + siblings[i].id) - .parent() - .before(li.html(div)); - li.slideDown('fast'); - return; - } - } - - // If we get here, this comment rates lower than all the others, - // or it is the only comment in the list. - ul.append(li.html(div)); - li.slideDown('fast'); - } - - function acceptComment(id) { - $.ajax({ - type: 'POST', - url: opts.acceptCommentURL, - data: {id: id}, - success: function(data, textStatus, request) { - $('#cm' + id).fadeOut('fast'); - $('#cd' + id).removeClass('moderate'); - }, - error: function(request, textStatus, error) { - showError('Oops, there was a problem accepting the comment.'); - } - }); - } - - function deleteComment(id) { - $.ajax({ - type: 'POST', - url: opts.deleteCommentURL, - data: {id: id}, - success: function(data, textStatus, request) { - var div = $('#cd' + id); - if (data == 'delete') { - // Moderator mode: remove the comment and all children immediately - div.slideUp('fast', function() { - div.remove(); - }); - return; - } - // User mode: only mark the comment as deleted - div - .find('span.user-id:first') - .text('[deleted]').end() - .find('div.comment-text:first') - .text('[deleted]').end() - .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id + - ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id) - .remove(); - var comment = div.data('comment'); - comment.username = '[deleted]'; - comment.text = '[deleted]'; - div.data('comment', comment); - }, - error: function(request, textStatus, error) { - showError('Oops, there was a problem deleting the comment.'); - } - }); - } - - function showProposal(id) { - $('#sp' + id).hide(); - $('#hp' + id).show(); - $('#pr' + id).slideDown('fast'); - } - - function hideProposal(id) { - $('#hp' + id).hide(); - $('#sp' + id).show(); - $('#pr' + id).slideUp('fast'); - } - - function showProposeChange(id) { - $('#pc' + id).hide(); - $('#hc' + id).show(); - var textarea = $('#pt' + id); - textarea.val(textarea.data('source')); - $.fn.autogrow.resize(textarea[0]); - textarea.slideDown('fast'); - } - - function hideProposeChange(id) { - $('#hc' + id).hide(); - $('#pc' + id).show(); - var textarea = $('#pt' + id); - textarea.val('').removeAttr('disabled'); - textarea.slideUp('fast'); - } - - function toggleCommentMarkupBox(id) { - $('#mb' + id).toggle(); - } - - /** Handle when the user clicks on a sort by link. */ - function handleReSort(link) { - var classes = link.attr('class').split(/\s+/); - for (var i=0; i<classes.length; i++) { - if (classes[i] != 'sort-option') { - by = classes[i].substring(2); - } - } - setComparator(); - // Save/update the sortBy cookie. - var expiration = new Date(); - expiration.setDate(expiration.getDate() + 365); - document.cookie= 'sortBy=' + escape(by) + - ';expires=' + expiration.toUTCString(); - $('ul.comment-ul').each(function(index, ul) { - var comments = getChildren($(ul), true); - comments = sortComments(comments); - appendComments(comments, $(ul).empty()); - }); - } - - /** - * Function to process a vote when a user clicks an arrow. - */ - function handleVote(link) { - if (!opts.voting) { - showError("You'll need to login to vote."); - return; - } - - var id = link.attr('id'); - if (!id) { - // Didn't click on one of the voting arrows. - return; - } - // If it is an unvote, the new vote value is 0, - // Otherwise it's 1 for an upvote, or -1 for a downvote. - var value = 0; - if (id.charAt(1) != 'u') { - value = id.charAt(0) == 'u' ? 1 : -1; - } - // The data to be sent to the server. - var d = { - comment_id: id.substring(2), - value: value - }; - - // Swap the vote and unvote links. - link.hide(); - $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id) - .show(); - - // The div the comment is displayed in. - var div = $('div#cd' + d.comment_id); - var data = div.data('comment'); - - // If this is not an unvote, and the other vote arrow has - // already been pressed, unpress it. - if ((d.value !== 0) && (data.vote === d.value * -1)) { - $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide(); - $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show(); - } - - // Update the comments rating in the local data. - data.rating += (data.vote === 0) ? d.value : (d.value - data.vote); - data.vote = d.value; - div.data('comment', data); - - // Change the rating text. - div.find('.rating:first') - .text(data.rating + ' point' + (data.rating == 1 ? '' : 's')); - - // Send the vote information to the server. - $.ajax({ - type: "POST", - url: opts.processVoteURL, - data: d, - error: function(request, textStatus, error) { - showError('Oops, there was a problem casting that vote.'); - } - }); - } - - /** - * Open a reply form used to reply to an existing comment. - */ - function openReply(id) { - // Swap out the reply link for the hide link - $('#rl' + id).hide(); - $('#cr' + id).show(); - - // Add the reply li to the children ul. - var div = $(renderTemplate(replyTemplate, {id: id})).hide(); - $('#cl' + id) - .prepend(div) - // Setup the submit handler for the reply form. - .find('#rf' + id) - .submit(function(event) { - event.preventDefault(); - addComment($('#rf' + id)); - closeReply(id); - }) - .find('input[type=button]') - .click(function() { - closeReply(id); - }); - div.slideDown('fast', function() { - $('#rf' + id).find('textarea').focus(); - }); - } - - /** - * Close the reply form opened with openReply. - */ - function closeReply(id) { - // Remove the reply div from the DOM. - $('#rd' + id).slideUp('fast', function() { - $(this).remove(); - }); - - // Swap out the hide link for the reply link - $('#cr' + id).hide(); - $('#rl' + id).show(); - } - - /** - * Recursively sort a tree of comments using the comp comparator. - */ - function sortComments(comments) { - comments.sort(comp); - $.each(comments, function() { - this.children = sortComments(this.children); - }); - return comments; - } - - /** - * Get the children comments from a ul. If recursive is true, - * recursively include childrens' children. - */ - function getChildren(ul, recursive) { - var children = []; - ul.children().children("[id^='cd']") - .each(function() { - var comment = $(this).data('comment'); - if (recursive) - comment.children = getChildren($(this).find('#cl' + comment.id), true); - children.push(comment); - }); - return children; - } - - /** Create a div to display a comment in. */ - function createCommentDiv(comment) { - if (!comment.displayed && !opts.moderator) { - return $('<div class="moderate">Thank you! Your comment will show up ' - + 'once it is has been approved by a moderator.</div>'); - } - // Prettify the comment rating. - comment.pretty_rating = comment.rating + ' point' + - (comment.rating == 1 ? '' : 's'); - // Make a class (for displaying not yet moderated comments differently) - comment.css_class = comment.displayed ? '' : ' moderate'; - // Create a div for this comment. - var context = $.extend({}, opts, comment); - var div = $(renderTemplate(commentTemplate, context)); - - // If the user has voted on this comment, highblight the correct arrow. - if (comment.vote) { - var direction = (comment.vote == 1) ? 'u' : 'd'; - div.find('#' + direction + 'v' + comment.id).hide(); - div.find('#' + direction + 'u' + comment.id).show(); - } - - if (opts.moderator || comment.text != '[deleted]') { - div.find('a.reply').show(); - if (comment.proposal_diff) - div.find('#sp' + comment.id).show(); - if (opts.moderator && !comment.displayed) - div.find('#cm' + comment.id).show(); - if (opts.moderator || (opts.username == comment.username)) - div.find('#dc' + comment.id).show(); - } - return div; - } - - /** - * A simple template renderer. Placeholders such as <%id%> are replaced - * by context['id'] with items being escaped. Placeholders such as <#id#> - * are not escaped. - */ - function renderTemplate(template, context) { - var esc = $(document.createElement('div')); - - function handle(ph, escape) { - var cur = context; - $.each(ph.split('.'), function() { - cur = cur[this]; - }); - return escape ? esc.text(cur || "").html() : cur; - } - - return template.replace(/<([%#])([\w\.]*)\1>/g, function() { - return handle(arguments[2], arguments[1] == '%' ? true : false); - }); - } - - /** Flash an error message briefly. */ - function showError(message) { - $(document.createElement('div')).attr({'class': 'popup-error'}) - .append($(document.createElement('div')) - .attr({'class': 'error-message'}).text(message)) - .appendTo('body') - .fadeIn("slow") - .delay(2000) - .fadeOut("slow"); - } - - /** Add a link the user uses to open the comments popup. */ - $.fn.comment = function() { - return this.each(function() { - var id = $(this).attr('id').substring(1); - var count = COMMENT_METADATA[id]; - var title = count + ' comment' + (count == 1 ? '' : 's'); - var image = count > 0 ? opts.commentBrightImage : opts.commentImage; - var addcls = count == 0 ? ' nocomment' : ''; - $(this) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-open' + addcls, - id: 'ao' + id - }) - .append($(document.createElement('img')).attr({ - src: image, - alt: 'comment', - title: title - })) - .click(function(event) { - event.preventDefault(); - show($(this).attr('id').substring(2)); - }) - ) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-close hidden', - id: 'ah' + id - }) - .append($(document.createElement('img')).attr({ - src: opts.closeCommentImage, - alt: 'close', - title: 'close' - })) - .click(function(event) { - event.preventDefault(); - hide($(this).attr('id').substring(2)); - }) - ); - }); - }; - - var opts = { - processVoteURL: '/_process_vote', - addCommentURL: '/_add_comment', - getCommentsURL: '/_get_comments', - acceptCommentURL: '/_accept_comment', - deleteCommentURL: '/_delete_comment', - commentImage: '/static/_static/comment.png', - closeCommentImage: '/static/_static/comment-close.png', - loadingImage: '/static/_static/ajax-loader.gif', - commentBrightImage: '/static/_static/comment-bright.png', - upArrow: '/static/_static/up.png', - downArrow: '/static/_static/down.png', - upArrowPressed: '/static/_static/up-pressed.png', - downArrowPressed: '/static/_static/down-pressed.png', - voting: false, - moderator: false - }; - - if (typeof COMMENT_OPTIONS != "undefined") { - opts = jQuery.extend(opts, COMMENT_OPTIONS); - } - - var popupTemplate = '\ - <div class="sphinx-comments" id="sc<%id%>">\ - <p class="sort-options">\ - Sort by:\ - <a href="#" class="sort-option byrating">best rated</a>\ - <a href="#" class="sort-option byascage">newest</a>\ - <a href="#" class="sort-option byage">oldest</a>\ - </p>\ - <div class="comment-header">Comments</div>\ - <div class="comment-loading" id="cn<%id%>">\ - loading comments... <img src="<%loadingImage%>" alt="" /></div>\ - <ul id="cl<%id%>" class="comment-ul"></ul>\ - <div id="ca<%id%>">\ - <p class="add-a-comment">Add a comment\ - (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\ - <div class="comment-markup-box" id="mb<%id%>">\ - reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \ - <tt>``code``</tt>, \ - code blocks: <tt>::</tt> and an indented block after blank line</div>\ - <form method="post" id="cf<%id%>" class="comment-form" action="">\ - <textarea name="comment" cols="80"></textarea>\ - <p class="propose-button">\ - <a href="#" id="pc<%id%>" class="show-propose-change">\ - Propose a change ▹\ - </a>\ - <a href="#" id="hc<%id%>" class="hide-propose-change">\ - Propose a change ▿\ - </a>\ - </p>\ - <textarea name="proposal" id="pt<%id%>" cols="80"\ - spellcheck="false"></textarea>\ - <input type="submit" value="Add comment" />\ - <input type="hidden" name="node" value="<%id%>" />\ - <input type="hidden" name="parent" value="" />\ - </form>\ - </div>\ - </div>'; - - var commentTemplate = '\ - <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\ - <div class="vote">\ - <div class="arrow">\ - <a href="#" id="uv<%id%>" class="vote" title="vote up">\ - <img src="<%upArrow%>" />\ - </a>\ - <a href="#" id="uu<%id%>" class="un vote" title="vote up">\ - <img src="<%upArrowPressed%>" />\ - </a>\ - </div>\ - <div class="arrow">\ - <a href="#" id="dv<%id%>" class="vote" title="vote down">\ - <img src="<%downArrow%>" id="da<%id%>" />\ - </a>\ - <a href="#" id="du<%id%>" class="un vote" title="vote down">\ - <img src="<%downArrowPressed%>" />\ - </a>\ - </div>\ - </div>\ - <div class="comment-content">\ - <p class="tagline comment">\ - <span class="user-id"><%username%></span>\ - <span class="rating"><%pretty_rating%></span>\ - <span class="delta"><%time.delta%></span>\ - </p>\ - <div class="comment-text comment"><#text#></div>\ - <p class="comment-opts comment">\ - <a href="#" class="reply hidden" id="rl<%id%>">reply ▹</a>\ - <a href="#" class="close-reply" id="cr<%id%>">reply ▿</a>\ - <a href="#" id="sp<%id%>" class="show-proposal">proposal ▹</a>\ - <a href="#" id="hp<%id%>" class="hide-proposal">proposal ▿</a>\ - <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\ - <span id="cm<%id%>" class="moderation hidden">\ - <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\ - </span>\ - </p>\ - <pre class="proposal" id="pr<%id%>">\ -<#proposal_diff#>\ - </pre>\ - <ul class="comment-children" id="cl<%id%>"></ul>\ - </div>\ - <div class="clearleft"></div>\ - </div>\ - </div>'; - - var replyTemplate = '\ - <li>\ - <div class="reply-div" id="rd<%id%>">\ - <form id="rf<%id%>">\ - <textarea name="comment" cols="80"></textarea>\ - <input type="submit" value="Add reply" />\ - <input type="button" value="Cancel" />\ - <input type="hidden" name="parent" value="<%id%>" />\ - <input type="hidden" name="node" value="" />\ - </form>\ - </div>\ - </li>'; - - $(document).ready(function() { - init(); - }); -})(jQuery); - -$(document).ready(function() { - // add comment anchors for all paragraphs that are commentable - $('.sphinx-has-comment').comment(); - - // highlight search words in search results - $("div.context").each(function() { - var params = $.getQueryParameters(); - var terms = (params.q) ? params.q[0].split(/\s+/) : []; - var result = $(this); - $.each(terms, function() { - result.highlightText(this.toLowerCase(), 'highlighted'); - }); - }); - - // directly open comment window if requested - var anchor = document.location.hash; - if (anchor.substring(0, 9) == '#comment-') { - $('#ao' + anchor.substring(9)).click(); - document.location.hash = '#s' + anchor.substring(9); - } -});
--- a/docs/filepaths.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>File Path Function Arguments — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <link rel="shortcut icon" href="_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="index.html" /> - <link rel="prev" title="pygame.transform" href="ref/transform.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="index.html">Help Contents</a> || - <a href="genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="ref/camera.html">camera</a> || - <a href="ref/cdrom.html">cdrom</a> || - <a href="ref/color.html">Color</a> || - <a href="ref/cursors.html">cursors</a> || - <a href="ref/display.html">display</a> || - <a href="ref/draw.html">draw</a> || - <a href="ref/event.html">event</a> || - <a href="ref/examples.html">examples</a> || - <a href="ref/font.html">font</a> || - <a href="ref/freetype.html">freetype</a> || - <a href="ref/gfxdraw.html">gfxdraw</a> || - <a href="ref/image.html">image</a> || - <a href="ref/joystick.html">joystick</a> || - <a href="ref/key.html">key</a> || - <a href="ref/locals.html">locals</a> || - <a href="ref/mask.html">mask</a> || - <a href="ref/math.html">math</a> || - <a href="ref/midi.html">midi</a> || - <a href="ref/mixer.html">mixer</a> || - <a href="ref/mouse.html">mouse</a> || - <a href="ref/movie.html">movie</a> || - <a href="ref/music.html">music</a> || - <a href="ref/overlay.html">Overlay</a> || - <a href="ref/pixelarray.html">PixelArray</a> || - <a href="ref/pixelcopy.html">pixelcopy</a> || - <a href="ref/pygame.html">pygame</a> || - <a href="ref/rect.html">Rect</a> || - <a href="ref/scrap.html">scrap</a> || - <a href="ref/sndarray.html">sndarray</a> || - <a href="ref/sprite.html">sprite</a> || - <a href="ref/surface.html">Surface</a> || - <a href="ref/surfarray.html">surfarray</a> || - <a href="ref/tests.html">tests</a> || - <a href="ref/time.html">time</a> || - <a href="ref/transform.html">transform</a> || - <a href="ref/pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="file-path-function-arguments"> -<div class="section" id="id1"> -<h2>File Path Function Arguments<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2> -<blockquote> -<p>A Pygame function or method which takes a file path argument -will accept either an Unicode or a byte — 8-bit or ASCII character — string. -Unicode strings are translated to Python’s default file system encoding, -as returned by sys.getfilesystemencoding(). -An Unicode code point above U+FFFF — ’uFFFF’ — can -be coded directly with a 32-bit escape -sequences — ’Uxxxxxxxx’ — , -even for Python interpreters built with an UCS-2 (16-bit character) unicode type. -Byte strings are passed to the operating system unchanged.</p> -<p>Null characters — ’x00’ — -are not permitted in the path, raising an exception. -An exception is also raised if an Unicode file path cannot be encoded. -How UTF-16 surrogate codes are handled is Python interpreter dependent. -Use UTF-32 code points and 32-bit escape sequences instead. -The exception types are function dependent.</p> -</blockquote> -</div> -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="ref/transform.html" title="pygame.transform" - accesskey="P">previous</a> |</li> - <li><a href="index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/genindex.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1065 +0,0 @@ - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Index — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <link rel="shortcut icon" href="_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="index.html" /> - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="#" title="General Index" - accesskey="I">index</a></li> - <li><a href="index.html">Pygame v1.9.2 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="body"> - - - <h1 id="index">Index</h1> - - <div class="genindex-jumpbox"> - <a href="#A"><strong>A</strong></a> | <a href="#B"><strong>B</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#D"><strong>D</strong></a> | <a href="#E"><strong>E</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#H"><strong>H</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#J"><strong>J</strong></a> | <a href="#K"><strong>K</strong></a> | <a href="#L"><strong>L</strong></a> | <a href="#M"><strong>M</strong></a> | <a href="#N"><strong>N</strong></a> | <a href="#O"><strong>O</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#Q"><strong>Q</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#T"><strong>T</strong></a> | <a href="#U"><strong>U</strong></a> | <a href="#V"><strong>V</strong></a> | <a href="#W"><strong>W</strong></a> - </div> -<h2 id="A">A</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/color.html#pygame.Color.a">a (pygame.Color attribute)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.aacircle">aacircle() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.aaellipse">aaellipse() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/draw.html#pygame.draw.aaline">aaline() (in module pygame.draw)</a></dt> - <dt><a href="ref/draw.html#pygame.draw.aalines">aalines() (in module pygame.draw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.aapolygon">aapolygon() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.aatrigon">aatrigon() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Output.abort">abort() (pygame.midi.Output method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Group.add">add() (pygame.sprite.Group method)</a></dt> - <dd><dl> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.add">(pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Sprite.add">(pygame.sprite.Sprite method)</a></dt> - </dl></dd> - <dt><a href="ref/examples.html#pygame.examples.aliens.main">aliens.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Sprite.alive">alive() (pygame.sprite.Sprite method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.angle">angle() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.angle_to">angle_to() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.angle_to">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/freetype.html#pygame.freetype.Font.antialiased">antialiased (pygame.freetype.Font attribute)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/draw.html#pygame.draw.arc">arc() (in module pygame.draw)</a></dt> - <dd><dl> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.arc">(in module pygame.gfxdraw)</a></dt> - </dl></dd> - <dt><a href="ref/sndarray.html#pygame.sndarray.array">array() (in module pygame.sndarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.array2d">array2d() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.array3d">array3d() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.array_alpha">array_alpha() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.array_colorkey">array_colorkey() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/pixelcopy.html#pygame.pixelcopy.array_to_surface">array_to_surface() (in module pygame.pixelcopy)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.arraydemo.main">arraydemo.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.as_polar">as_polar() (pygame.math.Vector2 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.as_spherical">as_spherical() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.ascender">ascender() (pygame.freetype.Font method)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.average_color">average_color() (in module pygame.transform)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.average_surfaces">average_surfaces() (in module pygame.transform)</a></dt> -</dl></td> -</tr></table> - -<h2 id="B">B</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/color.html#pygame.Color.b">b (pygame.Color attribute)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.bezier">bezier() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.blend_fill.main">blend_fill.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.blit">blit() (pygame.Surface method)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/surfarray.html#pygame.surfarray.blit_array">blit_array() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.blit_blends.main">blit_blends.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.box">box() (in module pygame.gfxdraw)</a></dt> -</dl></td> -</tr></table> - -<h2 id="C">C</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/camera.html#pygame.camera.Camera">Camera (class in pygame.camera)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.camera.main">camera.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD">CD (class in pygame.cdrom)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.centroid">centroid() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty.change_layer">change_layer() (pygame.sprite.LayeredDirty method)</a></dt> - <dd><dl> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.change_layer">(pygame.sprite.LayeredUpdates method)</a></dt> - </dl></dd> - <dt><a href="ref/mixer.html#pygame.mixer.Channel">Channel (class in pygame.mixer)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.chimp.main">chimp.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.chop">chop() (in module pygame.transform)</a></dt> - <dt><a href="ref/draw.html#pygame.draw.circle">circle() (in module pygame.draw)</a></dt> - <dd><dl> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.circle">(in module pygame.gfxdraw)</a></dt> - </dl></dd> - <dt><a href="ref/rect.html#pygame.Rect.clamp">clamp() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.clamp_ip">clamp_ip() (pygame.Rect method)</a></dt> - <dt><a href="ref/event.html#pygame.event.clear">clear() (in module pygame.event)</a></dt> - <dd><dl> - <dt><a href="ref/mask.html#pygame.mask.Mask.clear">(pygame.mask.Mask method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Group.clear">(pygame.sprite.Group method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty.clear">(pygame.sprite.LayeredDirty method)</a></dt> - </dl></dd> - <dt><a href="ref/rect.html#pygame.Rect.clip">clip() (pygame.Rect method)</a></dt> - <dt><a href="ref/time.html#pygame.time.Clock">Clock (class in pygame.time)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Input.close">close() (pygame.midi.Input method)</a></dt> - <dd><dl> - <dt><a href="ref/midi.html#pygame.midi.Output.close">(pygame.midi.Output method)</a></dt> - </dl></dd> - <dt><a href="ref/color.html#pygame.Color.cmy">cmy (pygame.Color attribute)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.collide_circle">collide_circle() (in module pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.collide_circle_ratio">collide_circle_ratio() (in module pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.collide_mask">collide_mask() (in module pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.collide_rect">collide_rect() (in module pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.collide_rect_ratio">collide_rect_ratio() (in module pygame.sprite)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/rect.html#pygame.Rect.collidedict">collidedict() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.collidedictall">collidedictall() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.collidelist">collidelist() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.collidelistall">collidelistall() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.collidepoint">collidepoint() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.colliderect">colliderect() (pygame.Rect method)</a></dt> - <dt><a href="ref/color.html#pygame.Color">Color (class in pygame)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.colorspace">colorspace() (in module pygame.camera)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.compare">compare() (pygame.PixelArray method)</a></dt> - <dt><a href="ref/cursors.html#pygame.cursors.compile">compile() (in module pygame.cursors)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.connected_component">connected_component() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.connected_components">connected_components() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/scrap.html#pygame.scrap.contains">contains() (in module pygame.scrap)</a></dt> - <dd><dl> - <dt><a href="ref/rect.html#pygame.Rect.contains">(pygame.Rect method)</a></dt> - </dl></dd> - <dt><a href="ref/surface.html#pygame.Surface.convert">convert() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.convert_alpha">convert_alpha() (pygame.Surface method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.convolve">convolve() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.copy">copy() (pygame.Rect method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.copy">(pygame.Surface method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Group.copy">(pygame.sprite.Group method)</a></dt> - </dl></dd> - <dt><a href="ref/color.html#pygame.Color.correct_gamma">correct_gamma() (pygame.Color method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.count">count() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.cross">cross() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.cross">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/examples.html#pygame.examples.cursors.main">cursors.main() (in module pygame.examples)</a></dt> -</dl></td> -</tr></table> - -<h2 id="D">D</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/time.html#pygame.time.delay">delay() (in module pygame.time)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.descender">descender (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.DirtySprite">DirtySprite (class in pygame.sprite)</a></dt> - <dt><a href="ref/math.html#pygame.math.disable_swizzling">disable_swizzling() (in module pygame.math)</a></dt> - <dt><a href="ref/overlay.html#pygame.Overlay.display">display() (pygame.Overlay method)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/math.html#pygame.math.Vector2.distance_squared_to">distance_squared_to() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.distance_squared_to">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/math.html#pygame.math.Vector2.distance_to">distance_to() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.distance_to">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/math.html#pygame.math.Vector2.dot">dot() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.dot">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/mask.html#pygame.mask.Mask.draw">draw() (pygame.mask.Mask method)</a></dt> - <dd><dl> - <dt><a href="ref/sprite.html#pygame.sprite.Group.draw">(pygame.sprite.Group method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty.draw">(pygame.sprite.LayeredDirty method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.draw">(pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.RenderUpdates.draw">(pygame.sprite.RenderUpdates method)</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="E">E</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.eject">eject() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.elementwise">elementwise() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.elementwise">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/draw.html#pygame.draw.ellipse">ellipse() (in module pygame.draw)</a></dt> - <dd><dl> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.ellipse">(in module pygame.gfxdraw)</a></dt> - </dl></dd> - <dt><a href="ref/sprite.html#pygame.sprite.Group.empty">empty() (pygame.sprite.Group method)</a></dt> - <dt><a href="ref/math.html#pygame.math.enable_swizzling">enable_swizzling() (in module pygame.math)</a></dt> - <dt><a href="ref/pygame.html#pygame.encode_file_path">encode_file_path() (in module pygame)</a></dt> - <dt><a href="ref/pygame.html#pygame.encode_string">encode_string() (in module pygame)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/mask.html#pygame.mask.Mask.erase">erase() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/pygame.html#pygame.error">error</a></dt> - <dt><a href="ref/event.html#pygame.event.Event">Event() (in module pygame.event)</a></dt> - <dt><a href="ref/event.html#pygame.event.event_name">event_name() (in module pygame.event)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.eventlist.main">eventlist.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.extract">extract() (pygame.PixelArray method)</a></dt> -</dl></td> -</tr></table> - -<h2 id="F">F</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/mixer.html#pygame.mixer.fadeout">fadeout() (in module pygame.mixer)</a></dt> - <dd><dl> - <dt><a href="ref/music.html#pygame.mixer.music.fadeout">(in module pygame.mixer.music)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.fadeout">(pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.fadeout">(pygame.mixer.Sound method)</a></dt> - </dl></dd> - <dt><a href="ref/examples.html#pygame.examples.fastevents.main">fastevents.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.fill">fill() (pygame.mask.Mask method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.fill">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.filled_circle">filled_circle() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.filled_ellipse">filled_ellipse() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.filled_polygon">filled_polygon() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.filled_trigon">filled_trigon() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.find_channel">find_channel() (in module pygame.mixer)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.fit">fit() (pygame.Rect method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.fixed_width">fixed_width (pygame.freetype.Font attribute)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/display.html#pygame.display.flip">flip() (in module pygame.display)</a></dt> - <dd><dl> - <dt><a href="ref/transform.html#pygame.transform.flip">(in module pygame.transform)</a></dt> - </dl></dd> - <dt><a href="ref/font.html#pygame.font.Font">Font (class in pygame.font)</a></dt> - <dd><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font">(class in pygame.freetype)</a></dt> - </dl></dd> - <dt><a href="ref/examples.html#pygame.examples.fonty.main">fonty.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.from_polar">from_polar() (pygame.math.Vector2 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.from_spherical">from_spherical() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.from_surface">from_surface() (in module pygame.mask)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.from_threshold">from_threshold() (in module pygame.mask)</a></dt> - <dt><a href="ref/image.html#pygame.image.frombuffer">frombuffer() (in module pygame.image)</a></dt> - <dt><a href="ref/image.html#pygame.image.fromstring">fromstring() (in module pygame.image)</a></dt> -</dl></td> -</tr></table> - -<h2 id="G">G</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/color.html#pygame.Color.g">g (pygame.Color attribute)</a></dt> - <dt><a href="ref/event.html#pygame.event.get">get() (in module pygame.event)</a></dt> - <dd><dl> - <dt><a href="ref/scrap.html#pygame.scrap.get">(in module pygame.scrap)</a></dt> - </dl></dd> - <dt><a href="ref/surface.html#pygame.Surface.get_abs_offset">get_abs_offset() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_abs_parent">get_abs_parent() (pygame.Surface method)</a></dt> - <dt><a href="ref/display.html#pygame.display.get_active">get_active() (in module pygame.display)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_all">get_all() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_alpha">get_alpha() (pygame.Surface method)</a></dt> - <dt><a href="ref/sndarray.html#pygame.sndarray.get_arraytype">get_arraytype() (in module pygame.sndarray)</a></dt> - <dd><dl> - <dt><a href="ref/surfarray.html#pygame.surfarray.get_arraytype">(in module pygame.surfarray)</a></dt> - </dl></dd> - <dt><a href="ref/sndarray.html#pygame.sndarray.get_arraytypes">get_arraytypes() (in module pygame.sndarray)</a></dt> - <dd><dl> - <dt><a href="ref/surfarray.html#pygame.surfarray.get_arraytypes">(in module pygame.surfarray)</a></dt> - </dl></dd> - <dt><a href="ref/font.html#pygame.font.Font.get_ascent">get_ascent() (pygame.font.Font method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.get_at">get_at() (pygame.mask.Mask method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.get_at">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/surface.html#pygame.Surface.get_at_mapped">get_at_mapped() (pygame.Surface method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_axis">get_axis() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_ball">get_ball() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_bitsize">get_bitsize() (pygame.Surface method)</a></dt> - <dt><a href="ref/event.html#pygame.event.get_blocked">get_blocked() (in module pygame.event)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.get_bold">get_bold() (pygame.font.Font method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.get_bottom_layer">get_bottom_layer() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_bounding_rect">get_bounding_rect() (pygame.Surface method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.get_bounding_rects">get_bounding_rects() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.get_buffer">get_buffer() (pygame.mixer.Sound method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.get_buffer">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/mixer.html#pygame.mixer.get_busy">get_busy() (in module pygame.mixer)</a></dt> - <dd><dl> - <dt><a href="ref/music.html#pygame.mixer.music.get_busy">(in module pygame.mixer.music)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_busy">(pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.get_busy">(pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.get_busy">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_button">get_button() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_bytesize">get_bytesize() (pygame.Surface method)</a></dt> - <dt><a href="ref/display.html#pygame.display.get_caption">get_caption() (in module pygame.display)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty.get_clip">get_clip() (pygame.sprite.LayeredDirty method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.get_clip">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/surface.html#pygame.Surface.get_colorkey">get_colorkey() (pygame.Surface method)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.Camera.get_controls">get_controls() (pygame.camera.Camera method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.get_count">get_count() (in module pygame.cdrom)</a></dt> - <dd><dl> - <dt><a href="ref/joystick.html#pygame.joystick.get_count">(in module pygame.joystick)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.get_count">(in module pygame.midi)</a></dt> - </dl></dd> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_current">get_current() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/mouse.html#pygame.mouse.get_cursor">get_cursor() (in module pygame.mouse)</a></dt> - <dt><a href="ref/font.html#pygame.font.get_default_font">get_default_font() (in module pygame.font)</a></dt> - <dd><dl> - <dt><a href="ref/freetype.html#pygame.freetype.get_default_font">(in module pygame.freetype)</a></dt> - </dl></dd> - <dt><a href="ref/midi.html#pygame.midi.get_default_input_id">get_default_input_id() (in module pygame.midi)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.get_default_output_id">get_default_output_id() (in module pygame.midi)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.get_default_resolution">get_default_resolution() (in module pygame.freetype)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.get_descent">get_descent() (pygame.font.Font method)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.get_device_info">get_device_info() (in module pygame.midi)</a></dt> - <dt><a href="ref/display.html#pygame.display.get_driver">get_driver() (in module pygame.display)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_empty">get_empty() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.get_endevent">get_endevent() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.get_endevent">(pygame.mixer.Channel method)</a></dt> - </dl></dd> - <dt><a href="ref/pygame.html#pygame.get_error">get_error() (in module pygame)</a></dt> - <dd><dl> - <dt><a href="ref/freetype.html#pygame.freetype.get_error">(in module pygame.freetype)</a></dt> - </dl></dd> - <dt><a href="ref/image.html#pygame.image.get_extended">get_extended() (in module pygame.image)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_flags">get_flags() (pygame.Surface method)</a></dt> - <dt><a href="ref/key.html#pygame.key.get_focused">get_focused() (in module pygame.key)</a></dt> - <dd><dl> - <dt><a href="ref/mouse.html#pygame.mouse.get_focused">(in module pygame.mouse)</a></dt> - </dl></dd> - <dt><a href="ref/font.html#pygame.font.get_fonts">get_fonts() (in module pygame.font)</a></dt> - <dt><a href="ref/time.html#pygame.time.Clock.get_fps">get_fps() (pygame.time.Clock method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.get_frame">get_frame() (pygame.movie.Movie method)</a></dt> - <dt><a href="ref/event.html#pygame.event.get_grab">get_grab() (in module pygame.event)</a></dt> - <dt><a href="ref/overlay.html#pygame.Overlay.get_hardware">get_hardware() (pygame.Overlay method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_hat">get_hat() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.get_height">get_height() (pygame.font.Font method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.get_height">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_id">get_id() (pygame.cdrom.CD method)</a></dt> - <dd><dl> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_id">(pygame.joystick.Joystick method)</a></dt> - </dl></dd> - <dt><a href="ref/camera.html#pygame.camera.Camera.get_image">get_image() (pygame.camera.Camera method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.get_init">get_init() (in module pygame.cdrom)</a></dt> - <dd><dl> - <dt><a href="ref/display.html#pygame.display.get_init">(in module pygame.display)</a></dt> - <dt><a href="ref/font.html#pygame.font.get_init">(in module pygame.font)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.get_init">(in module pygame.joystick)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.get_init">(in module pygame.mixer)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_init">(pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_init">(pygame.joystick.Joystick method)</a></dt> - </dl></dd> - <dt><a href="ref/font.html#pygame.font.Font.get_italic">get_italic() (pygame.font.Font method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.get_layer_of_sprite">get_layer_of_sprite() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.get_length">get_length() (pygame.mixer.Sound method)</a></dt> - <dd><dl> - <dt><a href="ref/movie.html#pygame.movie.Movie.get_length">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/font.html#pygame.font.Font.get_linesize">get_linesize() (pygame.font.Font method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_locked">get_locked() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_locks">get_locks() (pygame.Surface method)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/surface.html#pygame.Surface.get_losses">get_losses() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_masks">get_masks() (pygame.Surface method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.get_metrics">get_metrics() (pygame.freetype.Font method)</a></dt> - <dt><a href="ref/key.html#pygame.key.get_mods">get_mods() (in module pygame.key)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_name">get_name() (pygame.cdrom.CD method)</a></dt> - <dd><dl> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_name">(pygame.joystick.Joystick method)</a></dt> - </dl></dd> - <dt><a href="ref/mixer.html#pygame.mixer.get_num_channels">get_num_channels() (in module pygame.mixer)</a></dt> - <dd><dl> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.get_num_channels">(pygame.mixer.Sound method)</a></dt> - </dl></dd> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_numaxes">get_numaxes() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_numballs">get_numballs() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_numbuttons">get_numbuttons() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.get_numhats">get_numhats() (pygame.joystick.Joystick method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_numtracks">get_numtracks() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_offset">get_offset() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_palette">get_palette() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_palette_at">get_palette_at() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_parent">get_parent() (pygame.Surface method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_paused">get_paused() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_pitch">get_pitch() (pygame.Surface method)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.get_pos">get_pos() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/mouse.html#pygame.mouse.get_pos">(in module pygame.mouse)</a></dt> - </dl></dd> - <dt><a href="ref/key.html#pygame.key.get_pressed">get_pressed() (in module pygame.key)</a></dt> - <dd><dl> - <dt><a href="ref/mouse.html#pygame.mouse.get_pressed">(in module pygame.mouse)</a></dt> - </dl></dd> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.get_queue">get_queue() (pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.Camera.get_raw">get_raw() (pygame.camera.Camera method)</a></dt> - <dt><a href="ref/time.html#pygame.time.Clock.get_rawtime">get_rawtime() (pygame.time.Clock method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.get_rect">get_rect() (pygame.freetype.Font method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.get_rect">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/mouse.html#pygame.mouse.get_rel">get_rel() (in module pygame.mouse)</a></dt> - <dt><a href="ref/key.html#pygame.key.get_repeat">get_repeat() (in module pygame.key)</a></dt> - <dt><a href="ref/pygame.html#pygame.get_sdl_byteorder">get_sdl_byteorder() (in module pygame)</a></dt> - <dt><a href="ref/pygame.html#pygame.get_sdl_version">get_sdl_version() (in module pygame)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_shifts">get_shifts() (pygame.Surface method)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.Camera.get_size">get_size() (pygame.camera.Camera method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.get_size">(pygame.Surface method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.get_size">(pygame.mask.Mask method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.get_size">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/freetype.html#pygame.freetype.Font.get_sized_ascender">get_sized_ascender (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.get_sized_descender">get_sized_descender() (pygame.freetype.Font method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.get_sized_glyph_height">get_sized_glyph_height() (pygame.freetype.Font method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.get_sized_height">get_sized_height (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.get_smoothscale_backend">get_smoothscale_backend() (in module pygame.transform)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.get_sound">get_sound() (pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.get_sprite">get_sprite() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.get_sprites_at">get_sprites_at() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.get_sprites_from_layer">get_sprites_from_layer() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/display.html#pygame.display.get_surface">get_surface() (in module pygame.display)</a></dt> - <dt><a href="ref/time.html#pygame.time.get_ticks">get_ticks() (in module pygame.time)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.get_time">get_time() (pygame.movie.Movie method)</a></dt> - <dd><dl> - <dt><a href="ref/time.html#pygame.time.Clock.get_time">(pygame.time.Clock method)</a></dt> - </dl></dd> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.get_top_layer">get_top_layer() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.get_top_sprite">get_top_sprite() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_track_audio">get_track_audio() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_track_length">get_track_length() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.get_track_start">get_track_start() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/scrap.html#pygame.scrap.get_types">get_types() (in module pygame.scrap)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.get_underline">get_underline() (pygame.font.Font method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.get_version">get_version() (in module pygame.freetype)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.get_view">get_view() (pygame.Surface method)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.get_volume">get_volume() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.get_volume">(pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.get_volume">(pygame.mixer.Sound method)</a></dt> - </dl></dd> - <dt><a href="ref/surface.html#pygame.Surface.get_width">get_width() (pygame.Surface method)</a></dt> - <dt><a href="ref/display.html#pygame.display.get_wm_info">get_wm_info() (in module pygame.display)</a></dt> - <dt><a href="ref/display.html#pygame.display.gl_get_attribute">gl_get_attribute() (in module pygame.display)</a></dt> - <dt><a href="ref/display.html#pygame.display.gl_set_attribute">gl_set_attribute() (in module pygame.display)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.glcube.main">glcube.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Group">Group (class in pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.groupcollide">groupcollide() (in module pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Sprite.groups">groups() (pygame.sprite.Sprite method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.GroupSingle">GroupSingle() (in module pygame.sprite)</a></dt> -</dl></td> -</tr></table> - -<h2 id="H">H</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/sprite.html#pygame.sprite.Group.has">has() (pygame.sprite.Group method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.has_audio">has_audio() (pygame.movie.Movie method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.has_video">has_video() (pygame.movie.Movie method)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.headless_no_windows_needed.main">headless_no_windows_needed.main() (in module pygame.examples)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.height">height (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.hline">hline() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/color.html#pygame.Color.hsla">hsla (pygame.Color attribute)</a></dt> - <dt><a href="ref/color.html#pygame.Color.hsva">hsva (pygame.Color attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="I">I</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/color.html#pygame.Color.i1i2i3">i1i2i3 (pygame.Color attribute)</a></dt> - <dt><a href="ref/display.html#pygame.display.iconify">iconify() (in module pygame.display)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.inflate">inflate() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.inflate_ip">inflate_ip() (pygame.Rect method)</a></dt> - <dt><a href="ref/display.html#pygame.display.Info">Info() (in module pygame.display)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/pygame.html#pygame.init">init() (in module pygame)</a></dt> - <dd><dl> - <dt><a href="ref/cdrom.html#pygame.cdrom.init">(in module pygame.cdrom)</a></dt> - <dt><a href="ref/display.html#pygame.display.init">(in module pygame.display)</a></dt> - <dt><a href="ref/font.html#pygame.font.init">(in module pygame.font)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.init">(in module pygame.freetype)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.init">(in module pygame.joystick)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.init">(in module pygame.midi)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.init">(in module pygame.mixer)</a></dt> - <dt><a href="ref/scrap.html#pygame.scrap.init">(in module pygame.scrap)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.init">(pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.init">(pygame.joystick.Joystick method)</a></dt> - </dl></dd> - <dt><a href="ref/midi.html#pygame.midi.Input">Input (class in pygame.midi)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.invert">invert() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.is_normalized">is_normalized() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.is_normalized">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.itemsize">itemsize (pygame.PixelArray attribute)</a></dt> -</dl></td> -</tr></table> - -<h2 id="J">J</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick">Joystick (class in pygame.joystick)</a></dt> -</dl></td> -</tr></table> - -<h2 id="K">K</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.kerning">kerning (pygame.freetype.Font attribute)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/sprite.html#pygame.sprite.Sprite.kill">kill() (pygame.sprite.Sprite method)</a></dt> -</dl></td> -</tr></table> - -<h2 id="L">L</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/transform.html#pygame.transform.laplacian">laplacian() (in module pygame.transform)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty">LayeredDirty (class in pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates">LayeredUpdates (class in pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.layers">layers() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.length">length() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.length">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/math.html#pygame.math.Vector2.length_squared">length_squared() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.length_squared">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/math.html#pygame.math.Vector2.lerp">lerp() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.lerp">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/draw.html#pygame.draw.line">line() (in module pygame.draw)</a></dt> - <dd><dl> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.line">(in module pygame.gfxdraw)</a></dt> - </dl></dd> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/draw.html#pygame.draw.lines">lines() (in module pygame.draw)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.liquid.main">liquid.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.list_cameras">list_cameras() (in module pygame.camera)</a></dt> - <dt><a href="ref/display.html#pygame.display.list_modes">list_modes() (in module pygame.display)</a></dt> - <dt><a href="ref/image.html#pygame.image.load">load() (in module pygame.image)</a></dt> - <dd><dl> - <dt><a href="ref/music.html#pygame.mixer.music.load">(in module pygame.mixer.music)</a></dt> - </dl></dd> - <dt><a href="ref/cursors.html#pygame.cursors.load_xbm">load_xbm() (in module pygame.cursors)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.lock">lock() (pygame.Surface method)</a></dt> - <dt><a href="ref/scrap.html#pygame.scrap.lost">lost() (in module pygame.scrap)</a></dt> -</dl></td> -</tr></table> - -<h2 id="M">M</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/sndarray.html#pygame.sndarray.make_sound">make_sound() (in module pygame.sndarray)</a></dt> - <dt><a href="ref/pixelcopy.html#pygame.pixelcopy.make_surface">make_surface() (in module pygame.pixelcopy)</a></dt> - <dd><dl> - <dt><a href="ref/surfarray.html#pygame.surfarray.make_surface">(in module pygame.surfarray)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.make_surface">(pygame.PixelArray method)</a></dt> - </dl></dd> - <dt><a href="ref/pixelcopy.html#pygame.pixelcopy.map_array">map_array() (in module pygame.pixelcopy)</a></dt> - <dd><dl> - <dt><a href="ref/surfarray.html#pygame.surfarray.map_array">(in module pygame.surfarray)</a></dt> - </dl></dd> - <dt><a href="ref/surface.html#pygame.Surface.map_rgb">map_rgb() (pygame.Surface method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask">Mask (class in pygame.mask)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.mask.main">mask.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/font.html#pygame.font.match_font">match_font() (in module pygame.font)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.metrics">metrics() (pygame.font.Font method)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.midi.main">midi.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.MidiException">MidiException() (in module pygame.midi)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/midi.html#pygame.midi.midis2events">midis2events() (in module pygame.midi)</a></dt> - <dt><a href="ref/display.html#pygame.display.mode_ok">mode_ok() (in module pygame.display)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.move">move() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.move_ip">move_ip() (pygame.Rect method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.move_to_back">move_to_back() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.move_to_front">move_to_front() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.moveit.main">moveit.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie">Movie (class in pygame.movie)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.movieplayer.main">movieplayer.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.mustlock">mustlock() (pygame.Surface method)</a></dt> -</dl></td> -</tr></table> - -<h2 id="N">N</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.name">name (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/key.html#pygame.key.name">name() (in module pygame.key)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.ndim">ndim (pygame.PixelArray attribute)</a></dt> - <dt><a href="ref/color.html#pygame.Color.normalize">normalize() (pygame.Color method)</a></dt> - <dd><dl> - <dt><a href="ref/rect.html#pygame.Rect.normalize">(pygame.Rect method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.normalize">(pygame.math.Vector2 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.normalize">(pygame.math.Vector3 method)</a></dt> - </dl></dd> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/math.html#pygame.math.Vector2.normalize_ip">normalize_ip() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.normalize_ip">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/midi.html#pygame.midi.Output.note_off">note_off() (pygame.midi.Output method)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Output.note_on">note_on() (pygame.midi.Output method)</a></dt> -</dl></td> -</tr></table> - -<h2 id="O">O</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.oblique">oblique (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.oldalien.main">oldalien.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.OrderedUpdates">OrderedUpdates() (in module pygame.sprite)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.origin">origin (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.outline">outline() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Output">Output (class in pygame.midi)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/mask.html#pygame.mask.Mask.overlap">overlap() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.overlap_area">overlap_area() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.overlap_mask">overlap_mask() (pygame.mask.Mask method)</a></dt> - <dt><a href="ref/overlay.html#pygame.Overlay">Overlay (class in pygame)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.overlay.main">overlay.main() (in module pygame.examples)</a></dt> -</dl></td> -</tr></table> - -<h2 id="P">P</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.pad">pad (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.path">path (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.pause">pause() (in module pygame.mixer)</a></dt> - <dd><dl> - <dt><a href="ref/music.html#pygame.mixer.music.pause">(in module pygame.mixer.music)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.pause">(pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.pause">(pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.pause">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/event.html#pygame.event.peek">peek() (in module pygame.event)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.pie">pie() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.pixel">pixel() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray">PixelArray (class in pygame)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.pixelarray.main">pixelarray.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.pixels2d">pixels2d() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.pixels3d">pixels3d() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.pixels_alpha">pixels_alpha() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.pixels_blue">pixels_blue() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.pixels_green">pixels_green() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/surfarray.html#pygame.surfarray.pixels_red">pixels_red() (in module pygame.surfarray)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.play">play() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.play">(pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.play">(pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.play">(pygame.mixer.Sound method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.play">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/event.html#pygame.event.poll">poll() (in module pygame.event)</a></dt> - <dd><dl> - <dt><a href="ref/midi.html#pygame.midi.Input.poll">(pygame.midi.Input method)</a></dt> - </dl></dd> - <dt><a href="ref/draw.html#pygame.draw.polygon">polygon() (in module pygame.draw)</a></dt> - <dd><dl> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.polygon">(in module pygame.gfxdraw)</a></dt> - </dl></dd> - <dt><a href="ref/event.html#pygame.event.post">post() (in module pygame.event)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.pre_init">pre_init() (in module pygame.mixer)</a></dt> - <dt><a href="ref/event.html#pygame.event.pump">pump() (in module pygame.event)</a></dt> - <dt><a href="ref/scrap.html#pygame.scrap.put">put() (in module pygame.scrap)</a></dt> - <dt><a href="ref/pygame.html#module-pygame">pygame (module)</a></dt> - <dt><a href="ref/camera.html#module-pygame.camera">pygame.camera (module)</a></dt> - <dt><a href="ref/cdrom.html#module-pygame.cdrom">pygame.cdrom (module)</a></dt> - <dt><a href="ref/cursors.html#module-pygame.cursors">pygame.cursors (module)</a></dt> - <dt><a href="ref/display.html#module-pygame.display">pygame.display (module)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/draw.html#module-pygame.draw">pygame.draw (module)</a></dt> - <dt><a href="ref/event.html#module-pygame.event">pygame.event (module)</a></dt> - <dt><a href="ref/examples.html#module-pygame.examples">pygame.examples (module)</a></dt> - <dt><a href="ref/font.html#module-pygame.font">pygame.font (module)</a></dt> - <dt><a href="ref/freetype.html#module-pygame.freetype">pygame.freetype (module)</a></dt> - <dt><a href="ref/gfxdraw.html#module-pygame.gfxdraw">pygame.gfxdraw (module)</a></dt> - <dt><a href="ref/image.html#module-pygame.image">pygame.image (module)</a></dt> - <dt><a href="ref/joystick.html#module-pygame.joystick">pygame.joystick (module)</a></dt> - <dt><a href="ref/key.html#module-pygame.key">pygame.key (module)</a></dt> - <dt><a href="ref/locals.html#module-pygame.locals">pygame.locals (module)</a></dt> - <dt><a href="ref/mask.html#module-pygame.mask">pygame.mask (module)</a></dt> - <dt><a href="ref/math.html#module-pygame.math">pygame.math (module)</a></dt> - <dt><a href="ref/midi.html#module-pygame.midi">pygame.midi (module)</a></dt> - <dt><a href="ref/mixer.html#module-pygame.mixer">pygame.mixer (module)</a></dt> - <dt><a href="ref/music.html#module-pygame.mixer.music">pygame.mixer.music (module)</a></dt> - <dt><a href="ref/mouse.html#module-pygame.mouse">pygame.mouse (module)</a></dt> - <dt><a href="ref/movie.html#module-pygame.movie">pygame.movie (module)</a></dt> - <dt><a href="ref/pixelcopy.html#module-pygame.pixelcopy">pygame.pixelcopy (module)</a></dt> - <dt><a href="ref/scrap.html#module-pygame.scrap">pygame.scrap (module)</a></dt> - <dt><a href="ref/sndarray.html#module-pygame.sndarray">pygame.sndarray (module)</a></dt> - <dt><a href="ref/sprite.html#module-pygame.sprite">pygame.sprite (module)</a></dt> - <dt><a href="ref/surfarray.html#module-pygame.surfarray">pygame.surfarray (module)</a></dt> - <dt><a href="ref/tests.html#module-pygame.tests">pygame.tests (module)</a></dt> - <dt><a href="ref/time.html#module-pygame.time">pygame.time (module)</a></dt> - <dt><a href="ref/transform.html#module-pygame.transform">pygame.transform (module)</a></dt> - <dt><a href="ref/pygame.html#module-pygame.version">pygame.version (module)</a></dt> -</dl></td> -</tr></table> - -<h2 id="Q">Q</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/camera.html#pygame.camera.Camera.query_image">query_image() (pygame.camera.Camera method)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.queue">queue() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.queue">(pygame.mixer.Channel method)</a></dt> - </dl></dd> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/pygame.html#pygame.quit">quit() (in module pygame)</a></dt> - <dd><dl> - <dt><a href="ref/cdrom.html#pygame.cdrom.quit">(in module pygame.cdrom)</a></dt> - <dt><a href="ref/display.html#pygame.display.quit">(in module pygame.display)</a></dt> - <dt><a href="ref/font.html#pygame.font.quit">(in module pygame.font)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.quit">(in module pygame.freetype)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.quit">(in module pygame.joystick)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.quit">(in module pygame.midi)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.quit">(in module pygame.mixer)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.quit">(pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/joystick.html#pygame.joystick.Joystick.quit">(pygame.joystick.Joystick method)</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="R">R</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/color.html#pygame.Color.r">r (pygame.Color attribute)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Input.read">read() (pygame.midi.Input method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect">Rect (class in pygame)</a></dt> - <dt><a href="ref/draw.html#pygame.draw.rect">rect() (in module pygame.draw)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.rectangle">rectangle() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.reflect">reflect() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.reflect">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/math.html#pygame.math.Vector2.reflect_ip">reflect_ip() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.reflect_ip">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/pygame.html#pygame.register_quit">register_quit() (in module pygame)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Group.remove">remove() (pygame.sprite.Group method)</a></dt> - <dd><dl> - <dt><a href="ref/sprite.html#pygame.sprite.Sprite.remove">(pygame.sprite.Sprite method)</a></dt> - </dl></dd> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.remove_sprites_of_layer">remove_sprites_of_layer() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.render">render() (pygame.font.Font method)</a></dt> - <dd><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.render">(pygame.freetype.Font method)</a></dt> - </dl></dd> - <dt><a href="ref/movie.html#pygame.movie.Movie.render_frame">render_frame() (pygame.movie.Movie method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.render_raw">render_raw() (pygame.freetype.Font method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.render_raw_to">render_raw_to() (pygame.freetype.Font method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.render_to">render_to() (pygame.freetype.Font method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.RenderClear">RenderClear (class in pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.RenderPlain">RenderPlain (class in pygame.sprite)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/sprite.html#pygame.sprite.RenderUpdates">RenderUpdates (class in pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty.repaint_rect">repaint_rect() (pygame.sprite.LayeredDirty method)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.replace">replace() (pygame.PixelArray method)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.resolution">resolution (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.resume">resume() (pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.rewind">rewind() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/movie.html#pygame.movie.Movie.rewind">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/transform.html#pygame.transform.rotate">rotate() (in module pygame.transform)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector2.rotate">(pygame.math.Vector2 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/math.html#pygame.math.Vector2.rotate_ip">rotate_ip() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate_ip">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate_x">rotate_x() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate_x_ip">rotate_x_ip() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate_y">rotate_y() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate_y_ip">rotate_y_ip() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate_z">rotate_z() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3.rotate_z_ip">rotate_z_ip() (pygame.math.Vector3 method)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.rotozoom">rotozoom() (in module pygame.transform)</a></dt> - <dt><a href="ref/tests.html#pygame.tests.run">run() (in module pygame.tests)</a></dt> -</dl></td> -</tr></table> - -<h2 id="S">S</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/sndarray.html#pygame.sndarray.samples">samples() (in module pygame.sndarray)</a></dt> - <dt><a href="ref/image.html#pygame.image.save">save() (in module pygame.image)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.scale">scale() (in module pygame.transform)</a></dt> - <dd><dl> - <dt><a href="ref/mask.html#pygame.mask.Mask.scale">(pygame.mask.Mask method)</a></dt> - </dl></dd> - <dt><a href="ref/transform.html#pygame.transform.scale2x">scale2x() (in module pygame.transform)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.scale_to_length">scale_to_length() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.scale_to_length">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/examples.html#pygame.examples.scaletest.main">scaletest.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.scrap_clipboard.main">scrap_clipboard.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.scroll">scroll() (pygame.Surface method)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.scroll.main">scroll.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/event.html#pygame.event.set_allowed">set_allowed() (in module pygame.event)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.set_alpha">set_alpha() (pygame.Surface method)</a></dt> - <dt><a href="ref/mask.html#pygame.mask.Mask.set_at">set_at() (pygame.mask.Mask method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.set_at">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/event.html#pygame.event.set_blocked">set_blocked() (in module pygame.event)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.set_bold">set_bold() (pygame.font.Font method)</a></dt> - <dt><a href="ref/display.html#pygame.display.set_caption">set_caption() (in module pygame.display)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty.set_clip">set_clip() (pygame.sprite.LayeredDirty method)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.set_clip">(pygame.Surface method)</a></dt> - </dl></dd> - <dt><a href="ref/surface.html#pygame.Surface.set_colorkey">set_colorkey() (pygame.Surface method)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.Camera.set_controls">set_controls() (pygame.camera.Camera method)</a></dt> - <dt><a href="ref/mouse.html#pygame.mouse.set_cursor">set_cursor() (in module pygame.mouse)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.set_default_resolution">set_default_resolution() (in module pygame.freetype)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.set_display">set_display() (pygame.movie.Movie method)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.set_endevent">set_endevent() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.set_endevent">(pygame.mixer.Channel method)</a></dt> - </dl></dd> - <dt><a href="ref/pygame.html#pygame.set_error">set_error() (in module pygame)</a></dt> - <dt><a href="ref/display.html#pygame.display.set_gamma">set_gamma() (in module pygame.display)</a></dt> - <dt><a href="ref/display.html#pygame.display.set_gamma_ramp">set_gamma_ramp() (in module pygame.display)</a></dt> - <dt><a href="ref/event.html#pygame.event.set_grab">set_grab() (in module pygame.event)</a></dt> - <dt><a href="ref/display.html#pygame.display.set_icon">set_icon() (in module pygame.display)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Output.set_instrument">set_instrument() (pygame.midi.Output method)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.set_italic">set_italic() (pygame.font.Font method)</a></dt> - <dt><a href="ref/color.html#pygame.Color.set_length">set_length() (pygame.Color method)</a></dt> - <dt><a href="ref/overlay.html#pygame.Overlay.set_location">set_location() (pygame.Overlay method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.set_masks">set_masks() (pygame.Surface method)</a></dt> - <dt><a href="ref/display.html#pygame.display.set_mode">set_mode() (in module pygame.display)</a></dt> - <dd><dl> - <dt><a href="ref/scrap.html#pygame.scrap.set_mode">(in module pygame.scrap)</a></dt> - </dl></dd> - <dt><a href="ref/key.html#pygame.key.set_mods">set_mods() (in module pygame.key)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.set_num_channels">set_num_channels() (in module pygame.mixer)</a></dt> - <dt><a href="ref/display.html#pygame.display.set_palette">set_palette() (in module pygame.display)</a></dt> - <dd><dl> - <dt><a href="ref/surface.html#pygame.Surface.set_palette">(pygame.Surface method)</a></dt> - </dl></dd> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/surface.html#pygame.Surface.set_palette_at">set_palette_at() (pygame.Surface method)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.set_pos">set_pos() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/mouse.html#pygame.mouse.set_pos">(in module pygame.mouse)</a></dt> - </dl></dd> - <dt><a href="ref/key.html#pygame.key.set_repeat">set_repeat() (in module pygame.key)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.set_reserved">set_reserved() (in module pygame.mixer)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.set_shifts">set_shifts() (pygame.Surface method)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.set_smoothscale_backend">set_smoothscale_backend() (in module pygame.transform)</a></dt> - <dt><a href="ref/time.html#pygame.time.set_timer">set_timer() (in module pygame.time)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredDirty.set_timing_treshold">set_timing_treshold() (pygame.sprite.LayeredDirty method)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.set_underline">set_underline() (pygame.font.Font method)</a></dt> - <dt><a href="ref/mouse.html#pygame.mouse.set_visible">set_visible() (in module pygame.mouse)</a></dt> - <dt><a href="ref/music.html#pygame.mixer.music.set_volume">set_volume() (in module pygame.mixer.music)</a></dt> - <dd><dl> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.set_volume">(pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.set_volume">(pygame.mixer.Sound method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.set_volume">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.shape">shape (pygame.PixelArray attribute)</a></dt> - <dt><a href="ref/font.html#pygame.font.Font.size">size() (pygame.font.Font method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.skip">skip() (pygame.movie.Movie method)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector2.slerp">slerp() (pygame.math.Vector2 method)</a></dt> - <dd><dl> - <dt><a href="ref/math.html#pygame.math.Vector3.slerp">(pygame.math.Vector3 method)</a></dt> - </dl></dd> - <dt><a href="ref/transform.html#pygame.transform.smoothscale">smoothscale() (in module pygame.transform)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound">Sound (class in pygame.mixer)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.sound.main">sound.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.sound_array_demos.main">sound_array_demos.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Sprite">Sprite (class in pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.spritecollide">spritecollide() (in module pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.spritecollideany">spritecollideany() (in module pygame.sprite)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Group.sprites">sprites() (pygame.sprite.Group method)</a></dt> - <dd><dl> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.sprites">(pygame.sprite.LayeredUpdates method)</a></dt> - </dl></dd> - <dt><a href="ref/examples.html#pygame.examples.stars.main">stars.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.Camera.start">start() (pygame.camera.Camera method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.stop">stop() (in module pygame.mixer)</a></dt> - <dd><dl> - <dt><a href="ref/music.html#pygame.mixer.music.stop">(in module pygame.mixer.music)</a></dt> - <dt><a href="ref/camera.html#pygame.camera.Camera.stop">(pygame.camera.Camera method)</a></dt> - <dt><a href="ref/cdrom.html#pygame.cdrom.CD.stop">(pygame.cdrom.CD method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.stop">(pygame.mixer.Channel method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Sound.stop">(pygame.mixer.Sound method)</a></dt> - <dt><a href="ref/movie.html#pygame.movie.Movie.stop">(pygame.movie.Movie method)</a></dt> - </dl></dd> - <dt><a href="ref/freetype.html#pygame.freetype.Font.strength">strength (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.strides">strides (pygame.PixelArray attribute)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.strong">strong (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.style">style (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.subsurface">subsurface() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface">Surface (class in pygame)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.surface">surface (pygame.PixelArray attribute)</a></dt> - <dt><a href="ref/pixelcopy.html#pygame.pixelcopy.surface_to_array">surface_to_array() (in module pygame.pixelcopy)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.LayeredUpdates.switch_layer">switch_layer() (pygame.sprite.LayeredUpdates method)</a></dt> - <dt><a href="ref/font.html#pygame.font.SysFont">SysFont() (in module pygame.font)</a></dt> -</dl></td> -</tr></table> - -<h2 id="T">T</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/examples.html#pygame.examples.testsprite.main">testsprite.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.textured_polygon">textured_polygon() (in module pygame.gfxdraw)</a></dt> - <dt><a href="ref/transform.html#pygame.transform.threshold">threshold() (in module pygame.transform)</a></dt> - <dt><a href="ref/time.html#pygame.time.Clock.tick">tick() (pygame.time.Clock method)</a></dt> - <dt><a href="ref/time.html#pygame.time.Clock.tick_busy_loop">tick_busy_loop() (pygame.time.Clock method)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/midi.html#pygame.midi.time">time() (in module pygame.midi)</a></dt> - <dt><a href="ref/display.html#pygame.display.toggle_fullscreen">toggle_fullscreen() (in module pygame.display)</a></dt> - <dt><a href="ref/image.html#pygame.image.tostring">tostring() (in module pygame.image)</a></dt> - <dt><a href="ref/pixelarray.html#pygame.PixelArray.transpose">transpose() (pygame.PixelArray method)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.trigon">trigon() (in module pygame.gfxdraw)</a></dt> -</dl></td> -</tr></table> - -<h2 id="U">U</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.ucs4">ucs4 (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.underline">underline (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.underline_adjustment">underline_adjustment (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.union">union() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.union_ip">union_ip() (pygame.Rect method)</a></dt> - <dt><a href="ref/rect.html#pygame.Rect.unionall">unionall() (pygame.Rect method)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/rect.html#pygame.Rect.unionall_ip">unionall_ip() (pygame.Rect method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.unlock">unlock() (pygame.Surface method)</a></dt> - <dt><a href="ref/surface.html#pygame.Surface.unmap_rgb">unmap_rgb() (pygame.Surface method)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.unpause">unpause() (in module pygame.mixer)</a></dt> - <dd><dl> - <dt><a href="ref/music.html#pygame.mixer.music.unpause">(in module pygame.mixer.music)</a></dt> - <dt><a href="ref/mixer.html#pygame.mixer.Channel.unpause">(pygame.mixer.Channel method)</a></dt> - </dl></dd> - <dt><a href="ref/display.html#pygame.display.update">update() (in module pygame.display)</a></dt> - <dd><dl> - <dt><a href="ref/sprite.html#pygame.sprite.Group.update">(pygame.sprite.Group method)</a></dt> - <dt><a href="ref/sprite.html#pygame.sprite.Sprite.update">(pygame.sprite.Sprite method)</a></dt> - </dl></dd> - <dt><a href="ref/sndarray.html#pygame.sndarray.use_arraytype">use_arraytype() (in module pygame.sndarray)</a></dt> - <dd><dl> - <dt><a href="ref/surfarray.html#pygame.surfarray.use_arraytype">(in module pygame.surfarray)</a></dt> - </dl></dd> -</dl></td> -</tr></table> - -<h2 id="V">V</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/math.html#pygame.math.Vector2">Vector2 (class in pygame.math)</a></dt> - <dt><a href="ref/math.html#pygame.math.Vector3">Vector3 (class in pygame.math)</a></dt> - <dt><a href="ref/pygame.html#pygame.version.ver">ver (in module pygame.version)</a></dt> - <dt><a href="ref/pygame.html#pygame.version.vernum">vernum (in module pygame.version)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/freetype.html#pygame.freetype.Font.vertical">vertical (pygame.freetype.Font attribute)</a></dt> - <dt><a href="ref/examples.html#pygame.examples.vgrade.main">vgrade.main() (in module pygame.examples)</a></dt> - <dt><a href="ref/gfxdraw.html#pygame.gfxdraw.vline">vline() (in module pygame.gfxdraw)</a></dt> -</dl></td> -</tr></table> - -<h2 id="W">W</h2> -<table width="100%" class="indextable genindextable"><tr> - <td width="33%" valign="top"><dl> - <dt><a href="ref/event.html#pygame.event.wait">wait() (in module pygame.event)</a></dt> - <dd><dl> - <dt><a href="ref/time.html#pygame.time.wait">(in module pygame.time)</a></dt> - </dl></dd> - <dt><a href="ref/freetype.html#pygame.freetype.was_init">was_init() (in module pygame.freetype)</a></dt> - <dt><a href="ref/freetype.html#pygame.freetype.Font.wide">wide (pygame.freetype.Font attribute)</a></dt> -</dl></td> - <td width="33%" valign="top"><dl> - <dt><a href="ref/midi.html#pygame.midi.Output.write">write() (pygame.midi.Output method)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Output.write_short">write_short() (pygame.midi.Output method)</a></dt> - <dt><a href="ref/midi.html#pygame.midi.Output.write_sys_ex">write_sys_ex() (pygame.midi.Output method)</a></dt> -</dl></td> -</tr></table> - - - - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="#" title="General Index" - >index</a></li> - <li><a href="index.html">Pygame v1.9.2 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/index.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Pygame Front Page — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <link rel="shortcut icon" href="_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="#" /> - <link rel="next" title="pygame.camera" href="ref/camera.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="#">Help Contents</a> || - <a href="genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="ref/camera.html">camera</a> || - <a href="ref/cdrom.html">cdrom</a> || - <a href="ref/color.html">Color</a> || - <a href="ref/cursors.html">cursors</a> || - <a href="ref/display.html">display</a> || - <a href="ref/draw.html">draw</a> || - <a href="ref/event.html">event</a> || - <a href="ref/examples.html">examples</a> || - <a href="ref/font.html">font</a> || - <a href="ref/freetype.html">freetype</a> || - <a href="ref/gfxdraw.html">gfxdraw</a> || - <a href="ref/image.html">image</a> || - <a href="ref/joystick.html">joystick</a> || - <a href="ref/key.html">key</a> || - <a href="ref/locals.html">locals</a> || - <a href="ref/mask.html">mask</a> || - <a href="ref/math.html">math</a> || - <a href="ref/midi.html">midi</a> || - <a href="ref/mixer.html">mixer</a> || - <a href="ref/mouse.html">mouse</a> || - <a href="ref/movie.html">movie</a> || - <a href="ref/music.html">music</a> || - <a href="ref/overlay.html">Overlay</a> || - <a href="ref/pixelarray.html">PixelArray</a> || - <a href="ref/pixelcopy.html">pixelcopy</a> || - <a href="ref/pygame.html">pygame</a> || - <a href="ref/rect.html">Rect</a> || - <a href="ref/scrap.html">scrap</a> || - <a href="ref/sndarray.html">sndarray</a> || - <a href="ref/sprite.html">sprite</a> || - <a href="ref/surface.html">Surface</a> || - <a href="ref/surfarray.html">surfarray</a> || - <a href="ref/tests.html">tests</a> || - <a href="ref/time.html">time</a> || - <a href="ref/transform.html">transform</a> || - <a href="ref/pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="pygame-front-page"> -<h1>Pygame Front Page<a class="headerlink" href="#pygame-front-page" title="Permalink to this headline">¶</a></h1> -<div class="toctree-wrapper compound"> -</div> -<div class="section" id="documents"> -<h2>Documents<a class="headerlink" href="#documents" title="Permalink to this headline">¶</a></h2> -<dl class="docutils"> -<dt><a class="reference external" href="../readme.html">Readme</a></dt> -<dd>Basic information about Pygame, what it is, who is involved, and where to find it.</dd> -<dt><a class="reference external" href="../install.html">Install</a></dt> -<dd>Steps needed to compile Pygame on several platforms. -Also help on finding and installing prebuilt binaries for your system.</dd> -<dt><a class="reference external" href="filepaths.html">File Path Function Arguments</a></dt> -<dd>How Pygame handles file system paths.</dd> -<dt><a class="reference external" href="../LGPL">LGPL License</a></dt> -<dd>This is the license Pygame is distributed under. -It provides for Pygame to be distributed with open source and commercial software. -Generally, if Pygame is not changed, it can be used with any type of program.</dd> -</dl> -</div> -<div class="section" id="tutorials"> -<h2>Tutorials<a class="headerlink" href="#tutorials" title="Permalink to this headline">¶</a></h2> -<dl class="docutils"> -<dt><a class="reference external" href="tut/intro/intro.html">Introduction to Pygame</a></dt> -<dd>An introduction to the basics of Pygame. -This is written for users of Python and appeared in volume two of the Py magazine.</dd> -<dt><a class="reference external" href="tut/ImportInit.html">Import and Initialize</a></dt> -<dd>The beginning steps on importing and initializing Pygame. -The Pygame package is made of several modules. -Some modules are not included on all platforms.</dd> -<dt><a class="reference external" href="tut/MoveIt.html">How do I move an Image?</a></dt> -<dd>A basic tutorial that covers the concepts behind 2D computer animation. -Information about drawing and clearing objects to make them appear animated.</dd> -<dt><a class="reference external" href="tut/chimp/ChimpLineByLine.html">Chimp Tutorial, Line by Line</a></dt> -<dd>The pygame examples include a simple program with an interactive fist and a chimpanzee. -This was inspired by the annoying flash banner of the early 2000’s. -This tutorial examines every line of coded used in the example.</dd> -<dt><a class="reference external" href="tut/SpriteIntro.html">Sprite Module Introduction</a></dt> -<dd>Pygame includes a higher level sprite module to help organize games. -The sprite module includes several classes that help manage details found in almost all games types. -The Sprite classes are a bit more advanced than the regular Pygame modules, -and need more understanding to be properly used.</dd> -<dt><a class="reference external" href="tut/surfarray/SurfarrayIntro.html">Surfarray Introduction</a></dt> -<dd>Pygame used the Numpy python module to allow efficient per pixel effects on images. -Using the surfae arrays is an advanced feature that allows custom effects and filters. -This also examines some of the simple effects from the Pygame example, arraydemo.py.</dd> -<dt><a class="reference external" href="tut/camera/CameraIntro.html">Camera Module Introduction</a></dt> -<dd>Pygame, as of 1.9, has a camera module that allows you to capture images, -watch live streams, and do some basic computer vision. -This tutorial covers those use cases.</dd> -<dt><a class="reference external" href="tut/newbieguide.html">Newbie Guide</a></dt> -<dd>A list of thirteen helpful tips for people to get comfortable using Pygame.</dd> -<dt><a class="reference external" href="tut/tom/MakeGames.html">Making Games Tutorial</a></dt> -<dd>A large tutorial that covers the bigger topics needed to create an entire game.</dd> -</dl> -</div> -<div class="section" id="reference"> -<h2>Reference<a class="headerlink" href="#reference" title="Permalink to this headline">¶</a></h2> -<dl class="docutils"> -<dt><a class="reference internal" href="genindex.html"><em>Index</em></a></dt> -<dd>A list of all functions, classes, and methods in the Pygame package.</dd> -<dt><a class="reference internal" href="ref/cdrom.html"><em>pygame.cdrom</em></a></dt> -<dd>How to access and control the CD audio devices.</dd> -<dt><a class="reference internal" href="ref/color.html"><em>pygame.Color</em></a></dt> -<dd>Color representation.</dd> -<dt><a class="reference internal" href="ref/cursors.html"><em>pygame.cursors</em></a></dt> -<dd>Loading and compiling cursor images.</dd> -<dt><a class="reference internal" href="ref/display.html"><em>pygame.display</em></a></dt> -<dd>Configure the display surface.</dd> -<dt><a class="reference internal" href="ref/draw.html"><em>pygame.draw</em></a></dt> -<dd>Drawing simple shapes like lines and ellipses to surfaces.</dd> -<dt><a class="reference internal" href="ref/event.html"><em>pygame.event</em></a></dt> -<dd>Manage the incoming events from various input devices and the windowing platform.</dd> -<dt><a class="reference internal" href="ref/examples.html"><em>pygame.examples</em></a></dt> -<dd>Various programs demonstrating the use of individual pyame modules.</dd> -<dt><a class="reference internal" href="ref/font.html"><em>pygame.font</em></a></dt> -<dd>Loading and rendering Truetype fonts.</dd> -<dt><a class="reference internal" href="ref/freetype.html"><em>pygame.freetype</em></a></dt> -<dd>Enhanced Pygame module for loading and rendering font faces.</dd> -<dt><a class="reference internal" href="ref/gfxdraw.html"><em>pygame.gfxdraw</em></a></dt> -<dd>Anti-aliasing draw functions.</dd> -<dt><a class="reference internal" href="ref/image.html"><em>pygame.image</em></a></dt> -<dd>Loading, saving, and transferring of surfaces.</dd> -<dt><a class="reference internal" href="ref/joystick.html"><em>pygame.joystick</em></a></dt> -<dd>Manage the joystick devices.</dd> -<dt><a class="reference internal" href="ref/key.html"><em>pygame.key</em></a></dt> -<dd>Manage the keyboard device.</dd> -<dt><a class="reference internal" href="ref/locals.html"><em>pygame.locals</em></a></dt> -<dd>Pygame constants.</dd> -<dt><a class="reference internal" href="ref/mixer.html"><em>pygame.mixer</em></a></dt> -<dd>Load and play sounds</dd> -<dt><a class="reference internal" href="ref/mouse.html"><em>pygame.mouse</em></a></dt> -<dd>Manage the mouse device and display.</dd> -<dt><a class="reference internal" href="ref/movie.html"><em>pygame.movie</em></a></dt> -<dd>Video playback from MPEG movies.</dd> -<dt><a class="reference internal" href="ref/music.html"><em>pygame.mixer.music</em></a></dt> -<dd>Play streaming music tracks.</dd> -<dt><a class="reference internal" href="ref/overlay.html"><em>pygame.Overlay</em></a></dt> -<dd>Access advanced video overlays.</dd> -<dt><a class="reference internal" href="ref/pygame.html"><em>pygame</em></a></dt> -<dd>Top level functions to manage Pygame.</dd> -<dt><a class="reference internal" href="ref/pixelarray.html"><em>pygame.PixelArray</em></a></dt> -<dd>Manipulate image pixel data.</dd> -<dt><a class="reference internal" href="ref/rect.html"><em>pygame.Rect</em></a></dt> -<dd>Flexible container for a rectangle.</dd> -<dt><a class="reference internal" href="ref/scrap.html"><em>pygame.scrap</em></a></dt> -<dd>Native clipboard access.</dd> -<dt><a class="reference internal" href="ref/sndarray.html"><em>pygame.sndarray</em></a></dt> -<dd>Manipulate sound sample data.</dd> -<dt><a class="reference internal" href="ref/sprite.html"><em>pygame.sprite</em></a></dt> -<dd>Higher level objects to represent game images.</dd> -<dt><a class="reference internal" href="ref/surface.html"><em>pygame.Surface</em></a></dt> -<dd>Objects for images and the screen.</dd> -<dt><a class="reference internal" href="ref/surfarray.html"><em>pygame.surfarray</em></a></dt> -<dd>Manipulate image pixel data.</dd> -<dt><a class="reference internal" href="ref/tests.html"><em>pygame.tests</em></a></dt> -<dd>Test Pygame.</dd> -<dt><a class="reference internal" href="ref/time.html"><em>pygame.time</em></a></dt> -<dd>Manage timing and framerate.</dd> -<dt><a class="reference internal" href="ref/transform.html"><em>pygame.transform</em></a></dt> -<dd>Resize and move images.</dd> -<dt><a class="reference internal" href="search.html"><em>Search Page</em></a></dt> -<dd>Search Pygame documents by keyword.</dd> -</dl> -</div> -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="ref/camera.html" title="pygame.camera" - accesskey="N">next</a> |</li> - <li><a href="#">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/reST/themes/classic/elements.html Wed Jan 09 19:26:26 2013 +0100 +++ b/docs/reST/themes/classic/elements.html Thu Jan 10 14:49:00 2013 +0100 @@ -19,14 +19,13 @@ </td> <td class="pagelinks"> <p class="top"> - || <a href="{{ theme_home_uri }}">Pygame Home</a> || <a href="{{ pathto(master_doc) }}">Help Contents</a> || - <a href="{{ pathto('genindex') }}">Reference Index</a> || + <a href="{{ pathto('genindex') }}">Reference Index</a> </p> {%- if pyg_sections %} <p class="bottom"> -{% set sep = joiner(" || \n") %} +{% set sep = joiner(" | \n") %} {%- for section in pyg_sections %} {%- set docname = section['docname'] %} {%- set simpledocname = docname.split('/')[-1] %} @@ -49,7 +48,9 @@ #} {%- block body %} <div class="sectionwrapper"> + {%- if pagename != 'index' %} <h1>{{ title }}</h1> + {%- endif %} {%- block section %}{% endblock %} </div> {%- endblock %}
--- a/docs/reST/themes/classic/theme.conf Wed Jan 09 19:26:26 2013 +0100 +++ b/docs/reST/themes/classic/theme.conf Thu Jan 10 14:49:00 2013 +0100 @@ -36,6 +36,6 @@ headerborder = 3px solid black -bodyfont = serif -headfont = serif +bodyfont = sans-serif +headfont = sans-serif sigfont = monospace
--- a/docs/ref/camera.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,369 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.camera — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.cdrom" href="cdrom.html" /> - <link rel="prev" title="Pygame Front Page" href="../index.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.camera"> -<span id="pygame-camera"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.camera</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for camera use</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="38%" /> -<col width="1%" /> -<col width="61%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.colorspace">pygame.camera.colorspace</a></td> -<td>—</td> -<td>Surface colorspace conversion</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.list_cameras">pygame.camera.list_cameras</a></td> -<td>—</td> -<td>returns a list of available cameras</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera">pygame.camera.Camera</a></td> -<td>—</td> -<td>load a camera</td> -</tr> -</tbody> -</table> -<p>Pygame currently supports only Linux and v4l2 cameras.</p> -<p>EXPERIMENTAL!: This api may change or disappear in later pygame releases. If -you use this, your code will very likely break with the next pygame release.</p> -<p>The Bayer to <tt class="docutils literal"><span class="pre">RGB</span></tt> function is based on:</p> -<div class="highlight-python"><pre>Sonix SN9C101 based webcam basic I/F routines -Copyright (C) 2004 Takafumi Mizuno <taka-qce@ls-a.jp> -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE.</pre> -</div> -<p>New in pygame 1.9.0.</p> -<dl class="definition function"> -<dt class="title" id="pygame.camera.colorspace"> -<tt class="descclassname">pygame.camera.</tt><tt class="descname">colorspace</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.colorspace" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Surface colorspace conversion</span></div> -<div class="line"><span class="signature">colorspace(Surface, format, DestSurface = None) -> Surface</span></div> -</div> -<p>Allows for conversion from “RGB” to a destination colorspace of “HSV” or -“YUV”. The source and destination surfaces must be the same size and pixel -depth. This is useful for computer vision on devices with limited processing -power. Capture as small of an image as possible, <tt class="docutils literal"><span class="pre">transform.scale()</span></tt> it -even smaller, and then convert the colorspace to <tt class="docutils literal"><span class="pre">YUV</span></tt> or <tt class="docutils literal"><span class="pre">HSV</span></tt> before -doing any processing on it.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.camera.list_cameras"> -<tt class="descclassname">pygame.camera.</tt><tt class="descname">list_cameras</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.list_cameras" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a list of available cameras</span></div> -<div class="line"><span class="signature">list_cameras() -> [cameras]</span></div> -</div> -<p>Checks the computer for available cameras and returns a list of strings of -camera names, ready to be fed into <a class="tooltip reference internal" href="#pygame.camera.Camera" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.camera.Camera</span></tt><span class="tooltip-content">load a camera</span></a>.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.camera.Camera"> -<em class="property">class </em><tt class="descclassname">pygame.camera.</tt><tt class="descname">Camera</tt><a class="headerlink" href="#pygame.camera.Camera" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">load a camera</span></div> -<div class="line"><span class="signature">Camera(device, (width, height), format) -> Camera</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="36%" /> -<col width="1%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.start">pygame.camera.Camera.start</a></td> -<td>—</td> -<td>opens, initializes, and starts capturing</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.stop">pygame.camera.Camera.stop</a></td> -<td>—</td> -<td>stops, uninitializes, and closes the camera</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.get_controls">pygame.camera.Camera.get_controls</a></td> -<td>—</td> -<td>gets current values of user controls</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.set_controls">pygame.camera.Camera.set_controls</a></td> -<td>—</td> -<td>changes camera settings if supported by the camera</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.get_size">pygame.camera.Camera.get_size</a></td> -<td>—</td> -<td>returns the dimensions of the images being recorded</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.query_image">pygame.camera.Camera.query_image</a></td> -<td>—</td> -<td>checks if a frame is ready</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.get_image">pygame.camera.Camera.get_image</a></td> -<td>—</td> -<td>captures an image as a Surface</td> -</tr> -<tr><td><a class="toc reference external" href="camera.html#pygame.camera.Camera.get_raw">pygame.camera.Camera.get_raw</a></td> -<td>—</td> -<td>returns an unmodified image as a string</td> -</tr> -</tbody> -</table> -<p>Loads a v4l2 camera. The device is typically something like “/dev/video0”. -Default width and height are 640 by 480. Format is the desired colorspace of -the output. This is useful for computer vision purposes. The default is -<tt class="docutils literal"><span class="pre">RGB</span></tt>. The following are supported:</p> -<blockquote> -<ul class="simple"> -<li><tt class="docutils literal"><span class="pre">RGB</span></tt> - Red, Green, Blue</li> -<li><tt class="docutils literal"><span class="pre">YUV</span></tt> - Luma, Blue Chrominance, Red Chrominance</li> -<li><tt class="docutils literal"><span class="pre">HSV</span></tt> - Hue, Saturation, Value</li> -</ul> -</blockquote> -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.start"> -<tt class="descname">start</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.start" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">opens, initializes, and starts capturing</span></div> -<div class="line"><span class="signature">start() -> None</span></div> -</div> -<p>Opens the camera device, attempts to initialize it, and begins recording -images to a buffer. The camera must be started before any of the below -functions can be used.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.stop"> -<tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.stop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stops, uninitializes, and closes the camera</span></div> -<div class="line"><span class="signature">stop() -> None</span></div> -</div> -<p>Stops recording, uninitializes the camera, and closes it. Once a camera -is stopped, the below functions cannot be used until it is started again.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.get_controls"> -<tt class="descname">get_controls</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.get_controls" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">gets current values of user controls</span></div> -<div class="line"><span class="signature">get_controls() -> (hflip = bool, vflip = bool, brightness)</span></div> -</div> -<p>If the camera supports it, get_controls will return the current settings -for horizontal and vertical image flip as bools and brightness as an int. -If unsupported, it will return the default values of (0, 0, 0). Note that -the return values here may be different than those returned by -set_controls, though these are more likely to be correct.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.set_controls"> -<tt class="descname">set_controls</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.set_controls" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">changes camera settings if supported by the camera</span></div> -<div class="line"><span class="signature">set_controls(hflip = bool, vflip = bool, brightness) -> (hflip = bool, vflip = bool, brightness)</span></div> -</div> -<p>Allows you to change camera settings if the camera supports it. The -return values will be the input values if the camera claims it succeeded -or the values previously in use if not. Each argument is optional, and -the desired one can be chosen by supplying the keyword, like hflip. Note -that the actual settings being used by the camera may not be the same as -those returned by set_controls.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.get_size"> -<tt class="descname">get_size</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.get_size" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the dimensions of the images being recorded</span></div> -<div class="line"><span class="signature">get_size() -> (width, height)</span></div> -</div> -<p>Returns the current dimensions of the images being captured by the -camera. This will return the actual size, which may be different than the -one specified during initialization if the camera did not support that -size.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.query_image"> -<tt class="descname">query_image</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.query_image" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">checks if a frame is ready</span></div> -<div class="line"><span class="signature">query_image() -> bool</span></div> -</div> -<p>If an image is ready to get, it returns true. Otherwise it returns false. -Note that some webcams will always return False and will only queue a -frame when called with a blocking function like <tt class="docutils literal"><span class="pre">get_image()</span></tt>. This is -useful to separate the framerate of the game from that of the camera -without having to use threading.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.get_image"> -<tt class="descname">get_image</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.get_image" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">captures an image as a Surface</span></div> -<div class="line"><span class="signature">get_image(Surface = None) -> Surface</span></div> -</div> -<p>Pulls an image off of the buffer as an <tt class="docutils literal"><span class="pre">RGB</span></tt> Surface. It can optionally -reuse an existing Surface to save time. The bit depth of the surface is -either 24bits or the same as the optionally supplied Surface.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.camera.Camera.get_raw"> -<tt class="descname">get_raw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.camera.Camera.get_raw" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns an unmodified image as a string</span></div> -<div class="line"><span class="signature">get_raw() -> string</span></div> -</div> -<p>Gets an image from a camera as a string in the native pixelformat of the -camera. Useful for integration with other libraries.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="cdrom.html" title="pygame.cdrom" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="../index.html" title="Pygame Front Page" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/cdrom.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,550 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.cdrom — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.Color" href="color.html" /> - <link rel="prev" title="pygame.camera" href="camera.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.cdrom"> -<span id="pygame-cdrom"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.cdrom</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for audio cdrom control</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="32%" /> -<col width="1%" /> -<col width="66%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.init">pygame.cdrom.init</a></td> -<td>—</td> -<td>initialize the cdrom module</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.quit">pygame.cdrom.quit</a></td> -<td>—</td> -<td>uninitialize the cdrom module</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.get_init">pygame.cdrom.get_init</a></td> -<td>—</td> -<td>true if the cdrom module is initialized</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.get_count">pygame.cdrom.get_count</a></td> -<td>—</td> -<td>number of cd drives on the system</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD">pygame.cdrom.CD</a></td> -<td>—</td> -<td>class to manage a cdrom drive</td> -</tr> -</tbody> -</table> -<p>The cdrom module manages the <tt class="docutils literal"><span class="pre">CD</span></tt> and <tt class="docutils literal"><span class="pre">DVD</span></tt> drives on a computer. It can -also control the playback of audio cd’s. This module needs to be initialized -before it can do anything. Each <tt class="docutils literal"><span class="pre">CD</span></tt> object you create represents a cdrom -drive and must also be initialized individually before it can do most things.</p> -<dl class="definition function"> -<dt class="title" id="pygame.cdrom.init"> -<tt class="descclassname">pygame.cdrom.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize the cdrom module</span></div> -<div class="line"><span class="signature">init() -> None</span></div> -</div> -<p>Initialize the cdrom module. This will scan the system for all <tt class="docutils literal"><span class="pre">CD</span></tt> -devices. The module must be initialized before any other functions will -work. This automatically happens when you call <tt class="docutils literal"><span class="pre">pygame.init()</span></tt>.</p> -<p>It is safe to call this function more than once.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.cdrom.quit"> -<tt class="descclassname">pygame.cdrom.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize the cdrom module</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>Uninitialize the cdrom module. After you call this any existing <tt class="docutils literal"><span class="pre">CD</span></tt> -objects will no longer work.</p> -<p>It is safe to call this function more than once.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.cdrom.get_init"> -<tt class="descclassname">pygame.cdrom.</tt><tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.get_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the cdrom module is initialized</span></div> -<div class="line"><span class="signature">get_init() -> bool</span></div> -</div> -<p>Test if the cdrom module is initialized or not. This is different than the -<tt class="docutils literal"><span class="pre">CD.init()</span></tt> since each drive must also be initialized individually.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.cdrom.get_count"> -<tt class="descclassname">pygame.cdrom.</tt><tt class="descname">get_count</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.get_count" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">number of cd drives on the system</span></div> -<div class="line"><span class="signature">get_count() -> count</span></div> -</div> -<p>Return the number of cd drives on the system. When you create <tt class="docutils literal"><span class="pre">CD</span></tt> objects -you need to pass an integer id that must be lower than this count. The count -will be 0 if there are no drives on the system.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.cdrom.CD"> -<em class="property">class </em><tt class="descclassname">pygame.cdrom.</tt><tt class="descname">CD</tt><a class="headerlink" href="#pygame.cdrom.CD" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">class to manage a cdrom drive</span></div> -<div class="line"><span class="signature">CD(id) -> CD</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="41%" /> -<col width="1%" /> -<col width="58%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.init">pygame.cdrom.CD.init</a></td> -<td>—</td> -<td>initialize a cdrom drive for use</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.quit">pygame.cdrom.CD.quit</a></td> -<td>—</td> -<td>uninitialize a cdrom drive for use</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_init">pygame.cdrom.CD.get_init</a></td> -<td>—</td> -<td>true if this cd device initialized</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.play">pygame.cdrom.CD.play</a></td> -<td>—</td> -<td>start playing audio</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.stop">pygame.cdrom.CD.stop</a></td> -<td>—</td> -<td>stop audio playback</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.pause">pygame.cdrom.CD.pause</a></td> -<td>—</td> -<td>temporarily stop audio playback</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.resume">pygame.cdrom.CD.resume</a></td> -<td>—</td> -<td>unpause audio playback</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.eject">pygame.cdrom.CD.eject</a></td> -<td>—</td> -<td>eject or open the cdrom drive</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_id">pygame.cdrom.CD.get_id</a></td> -<td>—</td> -<td>the index of the cdrom drive</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_name">pygame.cdrom.CD.get_name</a></td> -<td>—</td> -<td>the system name of the cdrom drive</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_busy">pygame.cdrom.CD.get_busy</a></td> -<td>—</td> -<td>true if the drive is playing audio</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_paused">pygame.cdrom.CD.get_paused</a></td> -<td>—</td> -<td>true if the drive is paused</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_current">pygame.cdrom.CD.get_current</a></td> -<td>—</td> -<td>the current audio playback position</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_empty">pygame.cdrom.CD.get_empty</a></td> -<td>—</td> -<td>False if a cdrom is in the drive</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_numtracks">pygame.cdrom.CD.get_numtracks</a></td> -<td>—</td> -<td>the number of tracks on the cdrom</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_track_audio">pygame.cdrom.CD.get_track_audio</a></td> -<td>—</td> -<td>true if the cdrom track has audio data</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_all">pygame.cdrom.CD.get_all</a></td> -<td>—</td> -<td>get all track information</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_track_start">pygame.cdrom.CD.get_track_start</a></td> -<td>—</td> -<td>start time of a cdrom track</td> -</tr> -<tr><td><a class="toc reference external" href="cdrom.html#pygame.cdrom.CD.get_track_length">pygame.cdrom.CD.get_track_length</a></td> -<td>—</td> -<td>length of a cdrom track</td> -</tr> -</tbody> -</table> -<p>You can create a <tt class="docutils literal"><span class="pre">CD</span></tt> object for each cdrom on the system. Use -<tt class="docutils literal"><span class="pre">pygame.cdrom.get_count()</span></tt> to determine how many drives actually exist. -The id argument is an integer of the drive, starting at zero.</p> -<p>The <tt class="docutils literal"><span class="pre">CD</span></tt> object is not initialized, you can only call <tt class="docutils literal"><span class="pre">CD.get_id()</span></tt> and -<tt class="docutils literal"><span class="pre">CD.get_name()</span></tt> on an uninitialized drive.</p> -<p>It is safe to create multiple <tt class="docutils literal"><span class="pre">CD</span></tt> objects for the same drive, they will -all cooperate normally.</p> -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.init"> -<tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize a cdrom drive for use</span></div> -<div class="line"><span class="signature">init() -> None</span></div> -</div> -<p>Initialize the cdrom drive for use. The drive must be initialized for -most <tt class="docutils literal"><span class="pre">CD</span></tt> methods to work. Even if the rest of pygame has been -initialized.</p> -<p>There may be a brief pause while the drive is initialized. Avoid -<tt class="docutils literal"><span class="pre">CD.init()</span></tt> if the program should not stop for a second or two.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.quit"> -<tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize a cdrom drive for use</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>Uninitialize a drive for use. Call this when your program will not be -accessing the drive for awhile.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_init"> -<tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if this cd device initialized</span></div> -<div class="line"><span class="signature">get_init() -> bool</span></div> -</div> -<p>Test if this <tt class="docutils literal"><span class="pre">CDROM</span></tt> device is initialized. This is different than the -<tt class="docutils literal"><span class="pre">pygame.cdrom.init()</span></tt> since each drive must also be initialized -individually.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.play"> -<tt class="descname">play</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.play" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">start playing audio</span></div> -<div class="line"><span class="signature">play(track, start=None, end=None) -> None</span></div> -</div> -<p>Playback audio from an audio cdrom in the drive. Besides the track number -argument, you can also pass a starting and ending time for playback. The -start and end time are in seconds, and can limit the section of an audio -track played.</p> -<p>If you pass a start time but no end, the audio will play to the end of -the track. If you pass a start time and ‘None’ for the end time, the -audio will play to the end of the entire disc.</p> -<p>See the <tt class="docutils literal"><span class="pre">CD.get_numtracks()</span></tt> and <tt class="docutils literal"><span class="pre">CD.get_track_audio()</span></tt> to find -tracks to playback.</p> -<p>Note, track 0 is the first track on the <tt class="docutils literal"><span class="pre">CD</span></tt>. Track numbers start at -zero.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.stop"> -<tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.stop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop audio playback</span></div> -<div class="line"><span class="signature">stop() -> None</span></div> -</div> -<p>Stops playback of audio from the cdrom. This will also lose the current -playback position. This method does nothing if the drive isn’t already -playing audio.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.pause"> -<tt class="descname">pause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.pause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">temporarily stop audio playback</span></div> -<div class="line"><span class="signature">pause() -> None</span></div> -</div> -<p>Temporarily stop audio playback on the <tt class="docutils literal"><span class="pre">CD</span></tt>. The playback can be -resumed at the same point with the <tt class="docutils literal"><span class="pre">CD.resume()</span></tt> method. If the <tt class="docutils literal"><span class="pre">CD</span></tt> -is not playing this method does nothing.</p> -<p>Note, track 0 is the first track on the <tt class="docutils literal"><span class="pre">CD</span></tt>. Track numbers start at -zero.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.resume"> -<tt class="descname">resume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.resume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">unpause audio playback</span></div> -<div class="line"><span class="signature">resume() -> None</span></div> -</div> -<p>Unpause a paused <tt class="docutils literal"><span class="pre">CD</span></tt>. If the <tt class="docutils literal"><span class="pre">CD</span></tt> is not paused or already playing, -this method does nothing.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.eject"> -<tt class="descname">eject</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.eject" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">eject or open the cdrom drive</span></div> -<div class="line"><span class="signature">eject() -> None</span></div> -</div> -<p>This will open the cdrom drive and eject the cdrom. If the drive is -playing or paused it will be stopped.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_id"> -<tt class="descname">get_id</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_id" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the index of the cdrom drive</span></div> -<div class="line"><span class="signature">get_id() -> id</span></div> -</div> -<p>Returns the integer id that was used to create the <tt class="docutils literal"><span class="pre">CD</span></tt> instance. This -method can work on an uninitialized <tt class="docutils literal"><span class="pre">CD</span></tt>.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_name"> -<tt class="descname">get_name</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_name" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the system name of the cdrom drive</span></div> -<div class="line"><span class="signature">get_name() -> name</span></div> -</div> -<p>Return the string name of the drive. This is the system name used to -represent the drive. It is often the drive letter or device name. This -method can work on an uninitialized <tt class="docutils literal"><span class="pre">CD</span></tt>.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_busy"> -<tt class="descname">get_busy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_busy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the drive is playing audio</span></div> -<div class="line"><span class="signature">get_busy() -> bool</span></div> -</div> -<p>Returns True if the drive busy playing back audio.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_paused"> -<tt class="descname">get_paused</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_paused" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the drive is paused</span></div> -<div class="line"><span class="signature">get_paused() -> bool</span></div> -</div> -<p>Returns True if the drive is currently paused.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_current"> -<tt class="descname">get_current</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_current" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the current audio playback position</span></div> -<div class="line"><span class="signature">get_current() -> track, seconds</span></div> -</div> -<p>Returns both the current track and time of that track. This method works -when the drive is either playing or paused.</p> -<p>Note, track 0 is the first track on the <tt class="docutils literal"><span class="pre">CD</span></tt>. Track numbers start at -zero.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_empty"> -<tt class="descname">get_empty</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_empty" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">False if a cdrom is in the drive</span></div> -<div class="line"><span class="signature">get_empty() -> bool</span></div> -</div> -<p>Return False if there is a cdrom currently in the drive. If the drive is -empty this will return True.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_numtracks"> -<tt class="descname">get_numtracks</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_numtracks" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the number of tracks on the cdrom</span></div> -<div class="line"><span class="signature">get_numtracks() -> count</span></div> -</div> -<p>Return the number of tracks on the cdrom in the drive. This will return -zero of the drive is empty or has no tracks.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_track_audio"> -<tt class="descname">get_track_audio</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_track_audio" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the cdrom track has audio data</span></div> -<div class="line"><span class="signature">get_track_audio(track) -> bool</span></div> -</div> -<p>Determine if a track on a cdrom contains audio data. You can also call -<tt class="docutils literal"><span class="pre">CD.num_tracks()</span></tt> and <tt class="docutils literal"><span class="pre">CD.get_all()</span></tt> to determine more information -about the cdrom.</p> -<p>Note, track 0 is the first track on the <tt class="docutils literal"><span class="pre">CD</span></tt>. Track numbers start at -zero.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_all"> -<tt class="descname">get_all</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_all" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get all track information</span></div> -<div class="line"><span class="signature">get_all() -> [(audio, start, end, lenth), ...]</span></div> -</div> -<p>Return a list with information for every track on the cdrom. The -information consists of a tuple with four values. The audio value is True -if the track contains audio data. The start, end, and length values are -floating point numbers in seconds. Start and end represent absolute times -on the entire disc.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_track_start"> -<tt class="descname">get_track_start</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_track_start" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">start time of a cdrom track</span></div> -<div class="line"><span class="signature">get_track_start(track) -> seconds</span></div> -</div> -<p>Return the absolute time in seconds where at start of the cdrom track.</p> -<p>Note, track 0 is the first track on the <tt class="docutils literal"><span class="pre">CD</span></tt>. Track numbers start at -zero.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.cdrom.CD.get_track_length"> -<tt class="descname">get_track_length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cdrom.CD.get_track_length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">length of a cdrom track</span></div> -<div class="line"><span class="signature">get_track_length(track) -> seconds</span></div> -</div> -<p>Return a floating point value in seconds of the length of the cdrom -track.</p> -<p>Note, track 0 is the first track on the <tt class="docutils literal"><span class="pre">CD</span></tt>. Track numbers start at -zero.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="color.html" title="pygame.Color" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="camera.html" title="pygame.camera" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/color.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,337 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.Color — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.cursors" href="cursors.html" /> - <link rel="prev" title="pygame.cdrom" href="cdrom.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="pygame-color"> -<dl class="definition class"> -<dt class="title" id="pygame.Color"> -<em class="property">class </em><tt class="descclassname">pygame.</tt><tt class="descname">Color</tt><a class="headerlink" href="#pygame.Color" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame object for color representations</span></div> -<div class="line"><span class="signature">Color(name) -> Color</span></div> -<div class="line"><span class="signature">Color(r, g, b, a) -> Color</span></div> -<div class="line"><span class="signature">Color(rgbvalue) -> Color</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="30%" /> -<col width="1%" /> -<col width="69%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.r">pygame.Color.r</a></td> -<td>—</td> -<td>Gets or sets the red value of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.g">pygame.Color.g</a></td> -<td>—</td> -<td>Gets or sets the green value of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.b">pygame.Color.b</a></td> -<td>—</td> -<td>Gets or sets the blue value of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.a">pygame.Color.a</a></td> -<td>—</td> -<td>Gets or sets the alpha value of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.cmy">pygame.Color.cmy</a></td> -<td>—</td> -<td>Gets or sets the CMY representation of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.hsva">pygame.Color.hsva</a></td> -<td>—</td> -<td>Gets or sets the HSVA representation of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.hsla">pygame.Color.hsla</a></td> -<td>—</td> -<td>Gets or sets the HSLA representation of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.i1i2i3">pygame.Color.i1i2i3</a></td> -<td>—</td> -<td>Gets or sets the I1I2I3 representation of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.normalize">pygame.Color.normalize</a></td> -<td>—</td> -<td>Returns the normalized RGBA values of the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.correct_gamma">pygame.Color.correct_gamma</a></td> -<td>—</td> -<td>Applies a certain gamma value to the Color.</td> -</tr> -<tr><td><a class="toc reference external" href="color.html#pygame.Color.set_length">pygame.Color.set_length</a></td> -<td>—</td> -<td>Set the number of elements in the Color to 1,2,3, or 4.</td> -</tr> -</tbody> -</table> -<p>The Color class represents <tt class="docutils literal"><span class="pre">RGBA</span></tt> color values using a value range of -0-255. It allows basic arithmetic operations to create new colors, supports -conversions to other color spaces such as <tt class="docutils literal"><span class="pre">HSV</span></tt> or <tt class="docutils literal"><span class="pre">HSL</span></tt> and lets you -adjust single color channels. Alpha defaults to 255 when not given.</p> -<p>‘rgbvalue’ can be either a color name, an <tt class="docutils literal"><span class="pre">HTML</span></tt> color format string, a -hex number string, or an integer pixel value. The <tt class="docutils literal"><span class="pre">HTML</span></tt> format is -‘#rrggbbaa’, where rr, gg, bb, and aa are 2 digit hex numbers. The alpha aa -is optional. A hex number string has the form ‘0xrrggbbaa’, where aa is -optional.</p> -<p>Color objects support equality comparison with other color objects and 3 or -4 element tuples of integers (New in 1.9.0). There was a bug in pygame 1.8.1 -where the default alpha was 0, not 255 like previously.</p> -<p>New implementation of Color was done in pygame 1.8.1.</p> -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.r"> -<tt class="descname">r</tt><a class="headerlink" href="#pygame.Color.r" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the red value of the Color.</span></div> -<div class="line"><span class="signature">r -> int</span></div> -</div> -<p>The red value of the Color.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.g"> -<tt class="descname">g</tt><a class="headerlink" href="#pygame.Color.g" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the green value of the Color.</span></div> -<div class="line"><span class="signature">g -> int</span></div> -</div> -<p>The green value of the Color.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.b"> -<tt class="descname">b</tt><a class="headerlink" href="#pygame.Color.b" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the blue value of the Color.</span></div> -<div class="line"><span class="signature">b -> int</span></div> -</div> -<p>The blue value of the Color.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.a"> -<tt class="descname">a</tt><a class="headerlink" href="#pygame.Color.a" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the alpha value of the Color.</span></div> -<div class="line"><span class="signature">a -> int</span></div> -</div> -<p>The alpha value of the Color.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.cmy"> -<tt class="descname">cmy</tt><a class="headerlink" href="#pygame.Color.cmy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the CMY representation of the Color.</span></div> -<div class="line"><span class="signature">cmy -> tuple</span></div> -</div> -<p>The <tt class="docutils literal"><span class="pre">CMY</span></tt> representation of the Color. The <tt class="docutils literal"><span class="pre">CMY</span></tt> components are in -the ranges <tt class="docutils literal"><span class="pre">C</span></tt> = [0, 1], <tt class="docutils literal"><span class="pre">M</span></tt> = [0, 1], <tt class="docutils literal"><span class="pre">Y</span></tt> = [0, 1]. Note that this -will not return the absolutely exact <tt class="docutils literal"><span class="pre">CMY</span></tt> values for the set <tt class="docutils literal"><span class="pre">RGB</span></tt> -values in all cases. Due to the <tt class="docutils literal"><span class="pre">RGB</span></tt> mapping from 0-255 and the -<tt class="docutils literal"><span class="pre">CMY</span></tt> mapping from 0-1 rounding errors may cause the <tt class="docutils literal"><span class="pre">CMY</span></tt> values to -differ slightly from what you might expect.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.hsva"> -<tt class="descname">hsva</tt><a class="headerlink" href="#pygame.Color.hsva" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the HSVA representation of the Color.</span></div> -<div class="line"><span class="signature">hsva -> tuple</span></div> -</div> -<p>The <tt class="docutils literal"><span class="pre">HSVA</span></tt> representation of the Color. The <tt class="docutils literal"><span class="pre">HSVA</span></tt> components are in -the ranges <tt class="docutils literal"><span class="pre">H</span></tt> = [0, 360], <tt class="docutils literal"><span class="pre">S</span></tt> = [0, 100], <tt class="docutils literal"><span class="pre">V</span></tt> = [0, 100], A = [0, -100]. Note that this will not return the absolutely exact <tt class="docutils literal"><span class="pre">HSV</span></tt> values -for the set <tt class="docutils literal"><span class="pre">RGB</span></tt> values in all cases. Due to the <tt class="docutils literal"><span class="pre">RGB</span></tt> mapping from -0-255 and the <tt class="docutils literal"><span class="pre">HSV</span></tt> mapping from 0-100 and 0-360 rounding errors may -cause the <tt class="docutils literal"><span class="pre">HSV</span></tt> values to differ slightly from what you might expect.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.hsla"> -<tt class="descname">hsla</tt><a class="headerlink" href="#pygame.Color.hsla" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the HSLA representation of the Color.</span></div> -<div class="line"><span class="signature">hsla -> tuple</span></div> -</div> -<p>The <tt class="docutils literal"><span class="pre">HSLA</span></tt> representation of the Color. The <tt class="docutils literal"><span class="pre">HSLA</span></tt> components are in -the ranges <tt class="docutils literal"><span class="pre">H</span></tt> = [0, 360], <tt class="docutils literal"><span class="pre">S</span></tt> = [0, 100], <tt class="docutils literal"><span class="pre">V</span></tt> = [0, 100], A = [0, -100]. Note that this will not return the absolutely exact <tt class="docutils literal"><span class="pre">HSL</span></tt> values -for the set <tt class="docutils literal"><span class="pre">RGB</span></tt> values in all cases. Due to the <tt class="docutils literal"><span class="pre">RGB</span></tt> mapping from -0-255 and the <tt class="docutils literal"><span class="pre">HSL</span></tt> mapping from 0-100 and 0-360 rounding errors may -cause the <tt class="docutils literal"><span class="pre">HSL</span></tt> values to differ slightly from what you might expect.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.Color.i1i2i3"> -<tt class="descname">i1i2i3</tt><a class="headerlink" href="#pygame.Color.i1i2i3" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets or sets the I1I2I3 representation of the Color.</span></div> -<div class="line"><span class="signature">i1i2i3 -> tuple</span></div> -</div> -<p>The <tt class="docutils literal"><span class="pre">I1I2I3</span></tt> representation of the Color. The <tt class="docutils literal"><span class="pre">I1I2I3</span></tt> components are -in the ranges <tt class="docutils literal"><span class="pre">I1</span></tt> = [0, 1], <tt class="docutils literal"><span class="pre">I2</span></tt> = [-0.5, 0.5], <tt class="docutils literal"><span class="pre">I3</span></tt> = [-0.5, -0.5]. Note that this will not return the absolutely exact <tt class="docutils literal"><span class="pre">I1I2I3</span></tt> -values for the set <tt class="docutils literal"><span class="pre">RGB</span></tt> values in all cases. Due to the <tt class="docutils literal"><span class="pre">RGB</span></tt> -mapping from 0-255 and the <tt class="docutils literal"><span class="pre">I1I2I3</span></tt> mapping from 0-1 rounding errors -may cause the <tt class="docutils literal"><span class="pre">I1I2I3</span></tt> values to differ slightly from what you might -expect.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Color.normalize"> -<tt class="descname">normalize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Color.normalize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the normalized RGBA values of the Color.</span></div> -<div class="line"><span class="signature">normalize() -> tuple</span></div> -</div> -<p>Returns the normalized <tt class="docutils literal"><span class="pre">RGBA</span></tt> values of the Color as floating point -values.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Color.correct_gamma"> -<tt class="descname">correct_gamma</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Color.correct_gamma" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Applies a certain gamma value to the Color.</span></div> -<div class="line"><span class="signature">correct_gamma (gamma) -> Color</span></div> -</div> -<p>Applies a certain gamma value to the Color and returns a new Color with -the adjusted <tt class="docutils literal"><span class="pre">RGBA</span></tt> values.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Color.set_length"> -<tt class="descname">set_length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Color.set_length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Set the number of elements in the Color to 1,2,3, or 4.</span></div> -<div class="line"><span class="signature">set_length(len) -> None</span></div> -</div> -<p>The default Color length is 4. Colors can have lengths 1,2,3 or 4. This -is useful if you want to unpack to r,g,b and not r,g,b,a. If you want to -get the length of a Color do <tt class="docutils literal"><span class="pre">len(acolor)</span></tt>.</p> -<p>New in pygame 1.9.0.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="cursors.html" title="pygame.cursors" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="cdrom.html" title="pygame.cdrom" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/cursors.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,253 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.cursors — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.display" href="display.html" /> - <link rel="prev" title="pygame.Color" href="color.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.cursors"> -<span id="pygame-cursors"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.cursors</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for cursor resources</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="31%" /> -<col width="1%" /> -<col width="68%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="cursors.html#pygame.cursors.compile">pygame.cursors.compile</a></td> -<td>—</td> -<td>create binary cursor data from simple strings</td> -</tr> -<tr><td><a class="toc reference external" href="cursors.html#pygame.cursors.load_xbm">pygame.cursors.load_xbm</a></td> -<td>—</td> -<td>load cursor data from an xbm file</td> -</tr> -</tbody> -</table> -<p>Pygame offers control over the system hardware cursor. Pygame only supports -black and white cursors for the system. You control the cursor with functions -inside <a class="tooltip reference internal" href="mouse.html#module-pygame.mouse" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mouse</span></tt><span class="tooltip-content">pygame module to work with the mouse</span></a>.</p> -<p>This cursors module contains functions for loading and unencoding various -cursor formats. These allow you to easily store your cursors in external files -or directly as encoded python strings.</p> -<p>The module includes several standard cursors. The <tt class="docutils literal"><span class="pre">pygame.mouse.set_cursor()</span></tt> -function takes several arguments. All those arguments have been stored in a -single tuple you can call like this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">pygame</span><span class="o">.</span><span class="n">mouse</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="o">*</span><span class="n">pygame</span><span class="o">.</span><span class="n">cursors</span><span class="o">.</span><span class="n">arrow</span><span class="p">)</span> -</pre></div> -</div> -<p>This module also contains a few cursors as formatted strings. You’ll need to -pass these to <tt class="docutils literal"><span class="pre">pygame.cursors.compile()</span></tt> function before you can use them. -The example call would look like this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">cursor</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">cursors</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="n">pygame</span><span class="o">.</span><span class="n">cursors</span><span class="o">.</span><span class="n">textmarker_strings</span><span class="p">)</span> -<span class="gp">>>> </span><span class="n">pygame</span><span class="o">.</span><span class="n">mouse</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="o">*</span><span class="n">cursor</span><span class="p">)</span> -</pre></div> -</div> -<p>The following variables are cursor bitmaps that can be used as cursor:</p> -<blockquote> -<ul class="simple"> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.arrow</span></tt></li> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.diamond</span></tt></li> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.broken_x</span></tt></li> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.tri_left</span></tt></li> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.tri_right</span></tt></li> -</ul> -</blockquote> -<p>The following strings can be converted into cursor bitmaps with -<tt class="docutils literal"><span class="pre">pygame.cursors.compile()</span></tt> :</p> -<blockquote> -<ul class="simple"> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.thickarrow_strings</span></tt></li> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.sizer_x_strings</span></tt></li> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.sizer_y_strings</span></tt></li> -<li><tt class="docutils literal"><span class="pre">pygame.cursors.sizer_xy_strings</span></tt></li> -</ul> -</blockquote> -<dl class="definition function"> -<dt class="title" id="pygame.cursors.compile"> -<tt class="descclassname">pygame.cursors.</tt><tt class="descname">compile</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cursors.compile" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create binary cursor data from simple strings</span></div> -<div class="line"><span class="signature">compile(strings, black=’X’, white=’.’, xor=’o’) -> data, mask</span></div> -</div> -<p>A sequence of strings can be used to create binary cursor data for the -system cursor. The return values are the same format needed by -<tt class="docutils literal"><span class="pre">pygame.mouse.set_cursor()</span></tt>.</p> -<p>If you are creating your own cursor strings, you can use any value represent -the black and white pixels. Some system allow you to set a special toggle -color for the system color, this is also called the xor color. If the system -does not support xor cursors, that color will simply be black.</p> -<p>The width of the strings must all be equal and be divisible by 8. An example -set of cursor strings looks like this</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">thickarrow_strings</span> <span class="o">=</span> <span class="p">(</span> <span class="c">#sized 24x24</span> - <span class="s">"XX "</span><span class="p">,</span> - <span class="s">"XXX "</span><span class="p">,</span> - <span class="s">"XXXX "</span><span class="p">,</span> - <span class="s">"XX.XX "</span><span class="p">,</span> - <span class="s">"XX..XX "</span><span class="p">,</span> - <span class="s">"XX...XX "</span><span class="p">,</span> - <span class="s">"XX....XX "</span><span class="p">,</span> - <span class="s">"XX.....XX "</span><span class="p">,</span> - <span class="s">"XX......XX "</span><span class="p">,</span> - <span class="s">"XX.......XX "</span><span class="p">,</span> - <span class="s">"XX........XX "</span><span class="p">,</span> - <span class="s">"XX........XXX "</span><span class="p">,</span> - <span class="s">"XX......XXXXX "</span><span class="p">,</span> - <span class="s">"XX.XXX..XX "</span><span class="p">,</span> - <span class="s">"XXXX XX..XX "</span><span class="p">,</span> - <span class="s">"XX XX..XX "</span><span class="p">,</span> - <span class="s">" XX..XX "</span><span class="p">,</span> - <span class="s">" XX..XX "</span><span class="p">,</span> - <span class="s">" XX..XX "</span><span class="p">,</span> - <span class="s">" XXXX "</span><span class="p">,</span> - <span class="s">" XX "</span><span class="p">,</span> - <span class="s">" "</span><span class="p">,</span> - <span class="s">" "</span><span class="p">,</span> - <span class="s">" "</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.cursors.load_xbm"> -<tt class="descclassname">pygame.cursors.</tt><tt class="descname">load_xbm</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.cursors.load_xbm" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">load cursor data from an xbm file</span></div> -<div class="line"><span class="signature">load_xbm(cursorfile) -> cursor_args</span></div> -<div class="line"><span class="signature">load_xbm(cursorfile, maskfile) -> cursor_args</span></div> -</div> -<p>This loads cursors for a simple subset of <tt class="docutils literal"><span class="pre">XBM</span></tt> files. <tt class="docutils literal"><span class="pre">XBM</span></tt> files are -traditionally used to store cursors on unix systems, they are an ascii -format used to represent simple images.</p> -<p>Sometimes the black and white color values will be split into two separate -<tt class="docutils literal"><span class="pre">XBM</span></tt> files. You can pass a second maskfile argument to load the two -images into a single cursor.</p> -<p>The cursorfile and maskfile arguments can either be filenames or filelike -object with the readlines method.</p> -<p>The return value cursor_args can be passed directly to the -<tt class="docutils literal"><span class="pre">pygame.mouse.set_cursor()</span></tt> function.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="display.html" title="pygame.display" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="color.html" title="pygame.Color" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/display.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,651 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.display — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.draw" href="draw.html" /> - <link rel="prev" title="pygame.cursors" href="cursors.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.display"> -<span id="pygame-display"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.display</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module to control the display window and screen</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="34%" /> -<col width="1%" /> -<col width="65%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="display.html#pygame.display.init">pygame.display.init</a></td> -<td>—</td> -<td>initialize the display module</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.quit">pygame.display.quit</a></td> -<td>—</td> -<td>uninitialize the display module</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.get_init">pygame.display.get_init</a></td> -<td>—</td> -<td>true if the display module is initialized</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.set_mode">pygame.display.set_mode</a></td> -<td>—</td> -<td>initialize a window or screen for display</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.get_surface">pygame.display.get_surface</a></td> -<td>—</td> -<td>get a reference to the currently set display surface</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.flip">pygame.display.flip</a></td> -<td>—</td> -<td>update the full display Surface to the screen</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.update">pygame.display.update</a></td> -<td>—</td> -<td>update portions of the screen for software displays</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.get_driver">pygame.display.get_driver</a></td> -<td>—</td> -<td>get the name of the pygame display backend</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.Info">pygame.display.Info</a></td> -<td>—</td> -<td>Create a video display information object</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.get_wm_info">pygame.display.get_wm_info</a></td> -<td>—</td> -<td>Get information about the current windowing system</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.list_modes">pygame.display.list_modes</a></td> -<td>—</td> -<td>get list of available fullscreen modes</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.mode_ok">pygame.display.mode_ok</a></td> -<td>—</td> -<td>pick the best color depth for a display mode</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.gl_get_attribute">pygame.display.gl_get_attribute</a></td> -<td>—</td> -<td>get the value for an opengl flag for the current display</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.gl_set_attribute">pygame.display.gl_set_attribute</a></td> -<td>—</td> -<td>request an opengl display attribute for the display mode</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.get_active">pygame.display.get_active</a></td> -<td>—</td> -<td>true when the display is active on the display</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.iconify">pygame.display.iconify</a></td> -<td>—</td> -<td>iconify the display surface</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.toggle_fullscreen">pygame.display.toggle_fullscreen</a></td> -<td>—</td> -<td>switch between fullscreen and windowed displays</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.set_gamma">pygame.display.set_gamma</a></td> -<td>—</td> -<td>change the hardware gamma ramps</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.set_gamma_ramp">pygame.display.set_gamma_ramp</a></td> -<td>—</td> -<td>change the hardware gamma ramps with a custom lookup</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.set_icon">pygame.display.set_icon</a></td> -<td>—</td> -<td>change the system image for the display window</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.set_caption">pygame.display.set_caption</a></td> -<td>—</td> -<td>set the current window caption</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.get_caption">pygame.display.get_caption</a></td> -<td>—</td> -<td>get the current window caption</td> -</tr> -<tr><td><a class="toc reference external" href="display.html#pygame.display.set_palette">pygame.display.set_palette</a></td> -<td>—</td> -<td>set the display color palette for indexed displays</td> -</tr> -</tbody> -</table> -<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 class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt>.</p> -<p>Pygame can only have a single display active at any time. Creating a new one -with <tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt> will close the previous display. If precise -control is needed over the pixel format or display resolutions, use the -functions <tt class="docutils literal"><span class="pre">pygame.display.mode_ok()</span></tt>, <tt class="docutils literal"><span class="pre">pygame.display.list_modes()</span></tt>, and -<tt class="docutils literal"><span class="pre">pygame.display.Info()</span></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 class="docutils literal"><span class="pre">pygame.QUIT</span></tt> is sent when the user has requested the program to -shutdown. The window will receive <tt class="docutils literal"><span class="pre">pygame.ACTIVEEVENT</span></tt> events as the display -gains and loses input focus. If the display is set with the -<tt class="docutils literal"><span class="pre">pygame.RESIZABLE</span></tt> flag, <tt class="docutils literal"><span class="pre">pygame.VIDEORESIZE</span></tt> events will be sent when the -user adjusts the window dimensions. Hardware displays that draw direct to the -screen will get <tt class="docutils literal"><span class="pre">pygame.VIDEOEXPOSE</span></tt> events when portions of the window must -be redrawn.</p> -<dl class="definition function"> -<dt class="title" id="pygame.display.init"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize the display module</span></div> -<div class="line"><span class="signature">init() -> None</span></div> -</div> -<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 class="docutils literal"><span class="pre">pygame.init()</span></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 class="docutils literal"><span class="pre">SDL_VIDEODRIVER</span></tt> can be set to control which backend -is used. The systems with multiple choices are listed here.</p> -<div class="highlight-python"><pre>Windows : windib, directx -Unix : x11, dga, fbcon, directfb, ggi, vgl, svgalib, aalib</pre> -</div> -<p>On some platforms it is possible to embed the pygame display into an already -existing window. To do this, the environment variable <tt class="docutils literal"><span class="pre">SDL_WINDOWID</span></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> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.quit"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize the display module</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<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> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.get_init"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.get_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the display module is initialized</span></div> -<div class="line"><span class="signature">get_init() -> bool</span></div> -</div> -<p>Returns True if the <a class="tooltip reference internal" href="#module-pygame.display" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.display</span></tt><span class="tooltip-content">pygame module to control the display window and screen</span></a> module is currently initialized.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.set_mode"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">set_mode</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.set_mode" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize a window or screen for display</span></div> -<div class="line"><span class="signature">set_mode(resolution=(0,0), flags=0, depth=0) -> Surface</span></div> -</div> -<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 class="docutils literal"><span class="pre">SDL</span></tt> -version 1.2.10 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 class="docutils literal"><span class="pre">SDL</span></tt> version prior to 1.2.10 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> -<div class="highlight-python"><pre>pygame.FULLSCREEN create a fullscreen display -pygame.DOUBLEBUF recommended for HWSURFACE or OPENGL -pygame.HWSURFACE hardware accelerated, 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> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.get_surface"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">get_surface</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.get_surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get a reference to the currently set display surface</span></div> -<div class="line"><span class="signature">get_surface() -> Surface</span></div> -</div> -<p>Return a reference to the currently set display Surface. If no display mode -has been set this will return None.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.flip"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">flip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.flip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">update the full display Surface to the screen</span></div> -<div class="line"><span class="signature">flip() -> None</span></div> -</div> -<p>This will update the contents of the entire display. If your display mode is -using the flags <tt class="docutils literal"><span class="pre">pygame.HWSURFACE</span></tt> and <tt class="docutils literal"><span class="pre">pygame.DOUBLEBUF</span></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 class="docutils literal"><span class="pre">pygame.OPENGL</span></tt> display mode this will perform a gl buffer -swap.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.update"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">update</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.update" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">update portions of the screen for software displays</span></div> -<div class="line"><span class="signature">update(rectangle=None) -> None</span></div> -<div class="line"><span class="signature">update(rectangle_list) -> None</span></div> -</div> -<p>This function is like an optimized version of <tt class="docutils literal"><span class="pre">pygame.display.flip()</span></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 class="docutils literal"><span class="pre">pygame.display.flip()</span></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 class="docutils literal"><span class="pre">pygame.OPENGL</span></tt> displays and will generate an -exception.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.get_driver"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">get_driver</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.get_driver" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the name of the pygame display backend</span></div> -<div class="line"><span class="signature">get_driver() -> name</span></div> -</div> -<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 class="docutils literal"><span class="pre">SDL_VIDEODRIVER</span></tt> flags in -<tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt> to see some of the common options.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.Info"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">Info</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.Info" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Create a video display information object</span></div> -<div class="line"><span class="signature">Info() -> VideoInfo</span></div> -</div> -<p>Creates a simple object containing several attributes to describe the -current graphics environment. If this is called before -<tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></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> -<div class="highlight-python"><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> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.get_wm_info"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">get_wm_info</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.get_wm_info" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Get information about the current windowing system</span></div> -<div class="line"><span class="signature">get_wm_info() -> dict</span></div> -</div> -<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 1.7.1</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.list_modes"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">list_modes</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.list_modes" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get list of available fullscreen modes</span></div> -<div class="line"><span class="signature">list_modes(depth=0, flags=pygame.FULLSCREEN) -> list</span></div> -</div> -<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. A 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 class="docutils literal"><span class="pre">SDL</span></tt> will choose the current/best color depth for the -display. The flags defaults to <tt class="docutils literal"><span class="pre">pygame.FULLSCREEN</span></tt>, but you may need to -add additional flags for specific fullscreen modes.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.mode_ok"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">mode_ok</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.mode_ok" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pick the best color depth for a display mode</span></div> -<div class="line"><span class="signature">mode_ok(size, flags=0, depth=0) -> depth</span></div> -</div> -<p>This function uses the same arguments as <tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></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 class="docutils literal"><span class="pre">pygame.HWSURFACE</span></tt>, -<tt class="docutils literal"><span class="pre">pygame.DOUBLEBUF</span></tt>, and maybe <tt class="docutils literal"><span class="pre">pygame.FULLSCREEN</span></tt>. The function will -return 0 if these display flags cannot be set.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.gl_get_attribute"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">gl_get_attribute</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.gl_get_attribute" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the value for an opengl flag for the current display</span></div> -<div class="line"><span class="signature">gl_get_attribute(flag) -> value</span></div> -</div> -<p>After calling <tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt> with the <tt class="docutils literal"><span class="pre">pygame.OPENGL</span></tt> flag, -it is a good idea to check the value of any requested OpenGL attributes. See -<tt class="docutils literal"><span class="pre">pygame.display.gl_set_attribute()</span></tt> for a list of valid flags.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.gl_set_attribute"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">gl_set_attribute</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.gl_set_attribute" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">request an opengl display attribute for the display mode</span></div> -<div class="line"><span class="signature">gl_set_attribute(flag, value) -> None</span></div> -</div> -<p>When calling <tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt> with the <tt class="docutils literal"><span class="pre">pygame.OPENGL</span></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 class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt></p> -<p>The <tt class="docutils literal"><span class="pre">OPENGL</span></tt> flags are;</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">GL_ALPHA_SIZE</span><span class="p">,</span> <span class="n">GL_DEPTH_SIZE</span><span class="p">,</span> <span class="n">GL_STENCIL_SIZE</span><span class="p">,</span> <span class="n">GL_ACCUM_RED_SIZE</span><span class="p">,</span> -<span class="n">GL_ACCUM_GREEN_SIZE</span><span class="p">,</span> <span class="n">GL_ACCUM_BLUE_SIZE</span><span class="p">,</span> <span class="n">GL_ACCUM_ALPHA_SIZE</span><span class="p">,</span> -<span class="n">GL_MULTISAMPLEBUFFERS</span><span class="p">,</span> <span class="n">GL_MULTISAMPLESAMPLES</span><span class="p">,</span> <span class="n">GL_STEREO</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.get_active"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">get_active</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.get_active" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true when the display is active on the display</span></div> -<div class="line"><span class="signature">get_active() -> bool</span></div> -</div> -<p>After <tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></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> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.iconify"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">iconify</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.iconify" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">iconify the display surface</span></div> -<div class="line"><span class="signature">iconify() -> bool</span></div> -</div> -<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 class="docutils literal"><span class="pre">pygame.display.get_active()</span></tt> will return -False. The event queue should receive a <tt class="docutils literal"><span class="pre">ACTIVEEVENT</span></tt> event when the -window has been iconified.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.toggle_fullscreen"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">toggle_fullscreen</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.toggle_fullscreen" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">switch between fullscreen and windowed displays</span></div> -<div class="line"><span class="signature">toggle_fullscreen() -> bool</span></div> -</div> -<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 class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt> with new display flags.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.set_gamma"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">set_gamma</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.set_gamma" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">change the hardware gamma ramps</span></div> -<div class="line"><span class="signature">set_gamma(red, green=None, blue=None) -> bool</span></div> -</div> -<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>A gamma value of 1.0 creates a linear color table. Lower values will darken -the display and higher values will brighten.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.set_gamma_ramp"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">set_gamma_ramp</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.set_gamma_ramp" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">change the hardware gamma ramps with a custom lookup</span></div> -<div class="line"><span class="signature">set_gamma_ramp(red, green, blue) -> bool</span></div> -</div> -<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> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.set_icon"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">set_icon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.set_icon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">change the system image for the display window</span></div> -<div class="line"><span class="signature">set_icon(Surface) -> None</span></div> -</div> -<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 class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt> to create -the icon before the display mode is set.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.set_caption"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">set_caption</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.set_caption" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the current window caption</span></div> -<div class="line"><span class="signature">set_caption(title, icontitle=None) -> None</span></div> -</div> -<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> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.get_caption"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">get_caption</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.get_caption" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current window caption</span></div> -<div class="line"><span class="signature">get_caption() -> (title, icontitle)</span></div> -</div> -<p>Returns the title and icontitle for the display Surface. These will often be -the same value.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.display.set_palette"> -<tt class="descclassname">pygame.display.</tt><tt class="descname">set_palette</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.display.set_palette" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the display color palette for indexed displays</span></div> -<div class="line"><span class="signature">set_palette(palette=None) -> None</span></div> -</div> -<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 class="docutils literal"><span class="pre">RGB</span></tt> triplets.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="draw.html" title="pygame.draw" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="cursors.html" title="pygame.cursors" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/draw.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,313 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.draw — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.event" href="event.html" /> - <link rel="prev" title="pygame.display" href="display.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.draw"> -<span id="pygame-draw"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.draw</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for drawing shapes</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="27%" /> -<col width="1%" /> -<col width="72%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.rect">pygame.draw.rect</a></td> -<td>—</td> -<td>draw a rectangle shape</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.polygon">pygame.draw.polygon</a></td> -<td>—</td> -<td>draw a shape with any number of sides</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.circle">pygame.draw.circle</a></td> -<td>—</td> -<td>draw a circle around a point</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.ellipse">pygame.draw.ellipse</a></td> -<td>—</td> -<td>draw a round shape inside a rectangle</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.arc">pygame.draw.arc</a></td> -<td>—</td> -<td>draw a partial section of an ellipse</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.line">pygame.draw.line</a></td> -<td>—</td> -<td>draw a straight line segment</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.lines">pygame.draw.lines</a></td> -<td>—</td> -<td>draw multiple contiguous line segments</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.aaline">pygame.draw.aaline</a></td> -<td>—</td> -<td>draw fine antialiased lines</td> -</tr> -<tr><td><a class="toc reference external" href="draw.html#pygame.draw.aalines">pygame.draw.aalines</a></td> -<td>—</td> -<td>draw a connected sequence of antialiased lines</td> -</tr> -</tbody> -</table> -<p>Draw several simple shapes to a Surface. These functions will work for -rendering to any format of Surface. Rendering to hardware Surfaces will be -slower than regular software Surfaces.</p> -<p>Most of the functions take a width argument to represent the size of stroke -around the edge of the shape. If a width of 0 is passed the function will -actually solid fill the entire shape.</p> -<p>All the drawing functions respect the clip area for the Surface, and will be -constrained to that area. The functions return a rectangle representing the -bounding area of changed pixels.</p> -<p>Most of the arguments accept a color argument that is an <tt class="docutils literal"><span class="pre">RGB</span></tt> triplet. These -can also accept an <tt class="docutils literal"><span class="pre">RGBA</span></tt> quadruplet. The alpha value will be written -directly into the Surface if it contains pixel alphas, but the draw function -will not draw transparently. The color argument can also be an integer pixel -value that is already mapped to the Surface’s pixel format.</p> -<p>These functions must temporarily lock the Surface they are operating on. Many -sequential drawing calls can be sped up by locking and unlocking the Surface -object around the draw calls.</p> -<dl class="definition function"> -<dt class="title" id="pygame.draw.rect"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">rect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.rect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a rectangle shape</span></div> -<div class="line"><span class="signature">rect(Surface, color, Rect, width=0) -> Rect</span></div> -</div> -<p>Draws a rectangular shape on the Surface. The given Rect is the area of the -rectangle. The width argument is the thickness to draw the outer edge. If -width is zero then the rectangle will be filled.</p> -<p>Keep in mind the <tt class="docutils literal"><span class="pre">Surface.fill()</span></tt> method works just as well for drawing -filled rectangles. In fact the <tt class="docutils literal"><span class="pre">Surface.fill()</span></tt> can be hardware -accelerated on some platforms with both software and hardware display modes.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.polygon"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">polygon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.polygon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a shape with any number of sides</span></div> -<div class="line"><span class="signature">polygon(Surface, color, pointlist, width=0) -> Rect</span></div> -</div> -<p>Draws a polygonal shape on the Surface. The pointlist argument is the -vertices of the polygon. The width argument is the thickness to draw the -outer edge. If width is zero then the polygon will be filled.</p> -<p>For aapolygon, use aalines with the ‘closed’ parameter.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.circle"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">circle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.circle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a circle around a point</span></div> -<div class="line"><span class="signature">circle(Surface, color, pos, radius, width=0) -> Rect</span></div> -</div> -<p>Draws a circular shape on the Surface. The pos argument is the center of the -circle, and radius is the size. The width argument is the thickness to draw -the outer edge. If width is zero then the circle will be filled.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.ellipse"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">ellipse</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.ellipse" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a round shape inside a rectangle</span></div> -<div class="line"><span class="signature">ellipse(Surface, color, Rect, width=0) -> Rect</span></div> -</div> -<p>Draws an elliptical shape on the Surface. The given rectangle is the area -that the circle will fill. The width argument is the thickness to draw the -outer edge. If width is zero then the ellipse will be filled.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.arc"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">arc</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.arc" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a partial section of an ellipse</span></div> -<div class="line"><span class="signature">arc(Surface, color, Rect, start_angle, stop_angle, width=1) -> Rect</span></div> -</div> -<p>Draws an elliptical arc on the Surface. The rect argument is the area that -the ellipse will fill. The two angle arguments are the initial and final -angle in radians, with the zero on the right. The width argument is the -thickness to draw the outer edge.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.line"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">line</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.line" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a straight line segment</span></div> -<div class="line"><span class="signature">line(Surface, color, start_pos, end_pos, width=1) -> Rect</span></div> -</div> -<p>Draw a straight line segment on a Surface. There are no endcaps, the ends -are squared off for thick lines.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.lines"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">lines</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.lines" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw multiple contiguous line segments</span></div> -<div class="line"><span class="signature">lines(Surface, color, closed, pointlist, width=1) -> Rect</span></div> -</div> -<p>Draw a sequence of lines on a Surface. The pointlist argument is a series of -points that are connected by a line. If the closed argument is true an -additional line segment is drawn between the first and last points.</p> -<p>This does not draw any endcaps or miter joints. Lines with sharp corners and -wide line widths can have improper looking corners.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.aaline"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">aaline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.aaline" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw fine antialiased lines</span></div> -<div class="line"><span class="signature">aaline(Surface, color, startpos, endpos, blend=1) -> Rect</span></div> -</div> -<p>Draws an anti-aliased line on a surface. This will respect the clipping -rectangle. A bounding box of the affected area is returned returned as a -rectangle. If blend is true, the shades will be be blended with existing -pixel shades instead of overwriting them. This function accepts floating -point values for the end points.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.draw.aalines"> -<tt class="descclassname">pygame.draw.</tt><tt class="descname">aalines</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.draw.aalines" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a connected sequence of antialiased lines</span></div> -<div class="line"><span class="signature">aalines(Surface, color, closed, pointlist, blend=1) -> Rect</span></div> -</div> -<p>Draws a sequence on a surface. You must pass at least two points in the -sequence of points. The closed argument is a simple boolean and if true, a -line will be draw between the first and last points. The boolean blend -argument set to true will blend the shades with existing shades instead of -overwriting them. This function accepts floating point values for the end -points.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="event.html" title="pygame.event" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="display.html" title="pygame.display" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/event.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,460 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.event — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.examples" href="examples.html" /> - <link rel="prev" title="pygame.draw" href="draw.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.event"> -<span id="pygame-event"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.event</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for interacting with events and queues</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="27%" /> -<col width="1%" /> -<col width="72%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="event.html#pygame.event.pump">pygame.event.pump</a></td> -<td>—</td> -<td>internally process pygame event handlers</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.get">pygame.event.get</a></td> -<td>—</td> -<td>get events from the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.poll">pygame.event.poll</a></td> -<td>—</td> -<td>get a single event from the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.wait">pygame.event.wait</a></td> -<td>—</td> -<td>wait for a single event from the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.peek">pygame.event.peek</a></td> -<td>—</td> -<td>test if event types are waiting on the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.clear">pygame.event.clear</a></td> -<td>—</td> -<td>remove all events from the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.event_name">pygame.event.event_name</a></td> -<td>—</td> -<td>get the string name from and event id</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.set_blocked">pygame.event.set_blocked</a></td> -<td>—</td> -<td>control which events are allowed on the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.set_allowed">pygame.event.set_allowed</a></td> -<td>—</td> -<td>control which events are allowed on the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.get_blocked">pygame.event.get_blocked</a></td> -<td>—</td> -<td>test if a type of event is blocked from the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.set_grab">pygame.event.set_grab</a></td> -<td>—</td> -<td>control the sharing of input devices with other applications</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.get_grab">pygame.event.get_grab</a></td> -<td>—</td> -<td>test if the program is sharing input devices</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.post">pygame.event.post</a></td> -<td>—</td> -<td>place a new event on the queue</td> -</tr> -<tr><td><a class="toc reference external" href="event.html#pygame.event.Event">pygame.event.Event</a></td> -<td>—</td> -<td>create a new event object</td> -</tr> -</tbody> -</table> -<p>Pygame handles all it’s event messaging through an event queue. The routines in -this module help you manage that event queue. The input queue is heavily -dependent on the pygame display module. If the display has not been initialized -and a video mode not set, the event queue will not really work.</p> -<p>The queue is a regular queue of Event objects, there are a variety of ways to -access the events it contains. From simply checking for the existance of -events, to grabbing them directly off the stack.</p> -<p>All events have a type identifier. This event type is in between the values of -<tt class="docutils literal"><span class="pre">NOEVENT</span></tt> and <tt class="docutils literal"><span class="pre">NUMEVENTS</span></tt>. All user defined events can have the value of -<tt class="docutils literal"><span class="pre">USEREVENT</span></tt> or higher. It is recommended make sure your event id’s follow -this system.</p> -<p>To get the state of various input devices, you can forego the event queue and -access the input devices directly with their appropriate modules; mouse, key, -and joystick. If you use this method, remember that pygame requires some form -of communication with the system window manager and other parts of the -platform. To keep pygame in synch with the system, you will need to call -<tt class="docutils literal"><span class="pre">pygame.event.pump()</span></tt> to keep everything current. You’ll want to call this -function usually once per game loop.</p> -<p>The event queue offers some simple filtering. This can help performance -slightly by blocking certain event types from the queue, use the -<tt class="docutils literal"><span class="pre">pygame.event.set_allowed()</span></tt> and <tt class="docutils literal"><span class="pre">pygame.event.set_blocked()</span></tt> to work with -this filtering. All events default to allowed.</p> -<p>The event subsystem should be called from the main thread. If you want to post -events into the queue from other threads, please use the fastevent package.</p> -<p>Joysticks will not send any events until the device has been initialized.</p> -<p>An Event object contains an event type and a readonly set of member data. The -Event object contains no method functions, just member data. Event objects are -retrieved from the pygame event queue. You can create your own new events with -the <tt class="docutils literal"><span class="pre">pygame.event.Event()</span></tt> function.</p> -<p>Your program must take steps to keep the event queue from overflowing. If the -program is not clearing or getting all events off the queue at regular -intervals, it can overflow. When the queue overflows an exception is thrown.</p> -<p>All Event objects contain an event type identifier in the <tt class="docutils literal"><span class="pre">Event.type</span></tt> -member. You may also get full access to the Event’s member data through the -<tt class="docutils literal"><span class="pre">Event.dict</span></tt> method. All other member lookups will be passed through to the -Event’s dictionary values.</p> -<p>While debugging and experimenting, you can print the Event objects for a quick -display of its type and members. Events that come from the system will have a -guaranteed set of member items based on the type. Here is a list of the Event -members that are defined with each type.</p> -<div class="highlight-python"><pre>QUIT none -ACTIVEEVENT gain, state -KEYDOWN unicode, key, mod -KEYUP key, mod -MOUSEMOTION pos, rel, buttons -MOUSEBUTTONUP pos, button -MOUSEBUTTONDOWN pos, button -JOYAXISMOTION joy, axis, value -JOYBALLMOTION joy, ball, rel -JOYHATMOTION joy, hat, value -JOYBUTTONUP joy, button -JOYBUTTONDOWN joy, button -VIDEORESIZE size, w, h -VIDEOEXPOSE none -USEREVENT code</pre> -</div> -<p>Events support equality comparison. Two events are equal if they are the same -type and have identical attribute values. Inequality checks also work.</p> -<p class="versionadded"> -<span class="versionmodified">New in version 1.9.2.</span></p> -<dl class="definition function"> -<dt class="title" id="pygame.event.pump"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">pump</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.pump" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">internally process pygame event handlers</span></div> -<div class="line"><span class="signature">pump() -> None</span></div> -</div> -<p>For each frame of your game, you will need to make some sort of call to the -event queue. This ensures your program can internally interact with the rest -of the operating system. If you are not using other event functions in your -game, you should call <tt class="docutils literal"><span class="pre">pygame.event.pump()</span></tt> to allow pygame to handle -internal actions.</p> -<p>This function is not necessary if your program is consistently processing -events on the queue through the other <a class="tooltip reference internal" href="#module-pygame.event" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.event</span></tt><span class="tooltip-content">pygame module for interacting with events and queues</span></a> functions.</p> -<p>There are important things that must be dealt with internally in the event -queue. The main window may need to be repainted or respond to the system. If -you fail to make a call to the event queue for too long, the system may -decide your program has locked up.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.get"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">get</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.get" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get events from the queue</span></div> -<div class="line"><span class="signature">get() -> Eventlist</span></div> -<div class="line"><span class="signature">get(type) -> Eventlist</span></div> -<div class="line"><span class="signature">get(typelist) -> Eventlist</span></div> -</div> -<p>This will get all the messages and remove them from the queue. If a type or -sequence of types is given only those messages will be removed from the -queue.</p> -<p>If you are only taking specific events from the queue, be aware that the -queue could eventually fill up with the events you are not interested.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.poll"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">poll</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.poll" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get a single event from the queue</span></div> -<div class="line"><span class="signature">poll() -> Event</span></div> -</div> -<p>Returns a single event from the queue. If the event queue is empty an event -of type <tt class="docutils literal"><span class="pre">pygame.NOEVENT</span></tt> will be returned immediately. The returned event -is removed from the queue.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.wait"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">wait</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.wait" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">wait for a single event from the queue</span></div> -<div class="line"><span class="signature">wait() -> Event</span></div> -</div> -<p>Returns a single event from the queue. If the queue is empty this function -will wait until one is created. The event is removed from the queue once it -has been returned. While the program is waiting it will sleep in an idle -state. This is important for programs that want to share the system with -other applications.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.peek"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">peek</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.peek" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if event types are waiting on the queue</span></div> -<div class="line"><span class="signature">peek(type) -> bool</span></div> -<div class="line"><span class="signature">peek(typelist) -> bool</span></div> -</div> -<p>Returns true if there are any events of the given type waiting on the queue. -If a sequence of event types is passed, this will return True if any of -those events are on the queue.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.clear"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.clear" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">remove all events from the queue</span></div> -<div class="line"><span class="signature">clear() -> None</span></div> -<div class="line"><span class="signature">clear(type) -> None</span></div> -<div class="line"><span class="signature">clear(typelist) -> None</span></div> -</div> -<p>Remove all events or events of a specific type from the queue. This has the -same effect as <tt class="docutils literal"><span class="pre">pygame.event.get()</span></tt> except nothing is returned. This can -be slightly more effecient when clearing a full event queue.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.event_name"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">event_name</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.event_name" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the string name from and event id</span></div> -<div class="line"><span class="signature">event_name(type) -> string</span></div> -</div> -<p>Pygame uses integer ids to represent the event types. If you want to report -these types to the user they should be converted to strings. This will -return a the simple name for an event type. The string is in the WordCap -style.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.set_blocked"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">set_blocked</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.set_blocked" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">control which events are allowed on the queue</span></div> -<div class="line"><span class="signature">set_blocked(type) -> None</span></div> -<div class="line"><span class="signature">set_blocked(typelist) -> None</span></div> -<div class="line"><span class="signature">set_blocked(None) -> None</span></div> -</div> -<p>The given event types are not allowed to appear on the event queue. By -default all events can be placed on the queue. It is safe to disable an -event type multiple times.</p> -<p>If None is passed as the argument, this has the opposite effect and <tt class="docutils literal"><span class="pre">ALL</span></tt> -of the event types are allowed to be placed on the queue.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.set_allowed"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">set_allowed</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.set_allowed" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">control which events are allowed on the queue</span></div> -<div class="line"><span class="signature">set_allowed(type) -> None</span></div> -<div class="line"><span class="signature">set_allowed(typelist) -> None</span></div> -<div class="line"><span class="signature">set_allowed(None) -> None</span></div> -</div> -<p>The given event types are allowed to appear on the event queue. By default -all events can be placed on the queue. It is safe to enable an event type -multiple times.</p> -<p>If None is passed as the argument, <tt class="docutils literal"><span class="pre">NONE</span></tt> of the event types are allowed -to be placed on the queue.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.get_blocked"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">get_blocked</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.get_blocked" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if a type of event is blocked from the queue</span></div> -<div class="line"><span class="signature">get_blocked(type) -> bool</span></div> -</div> -<p>Returns true if the given event type is blocked from the queue.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.set_grab"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">set_grab</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.set_grab" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">control the sharing of input devices with other applications</span></div> -<div class="line"><span class="signature">set_grab(bool) -> None</span></div> -</div> -<p>When your program runs in a windowed environment, it will share the mouse -and keyboard devices with other applications that have focus. If your -program sets the event grab to True, it will lock all input into your -program.</p> -<p>It is best to not always grab the input, since it prevents the user from -doing other things on their system.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.get_grab"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">get_grab</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.get_grab" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if the program is sharing input devices</span></div> -<div class="line"><span class="signature">get_grab() -> bool</span></div> -</div> -<p>Returns true when the input events are grabbed for this application. Use -<tt class="docutils literal"><span class="pre">pygame.event.set_grab()</span></tt> to control this state.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.post"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">post</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.post" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">place a new event on the queue</span></div> -<div class="line"><span class="signature">post(Event) -> None</span></div> -</div> -<p>This places a new event at the end of the event queue. These Events will -later be retrieved from the other queue functions.</p> -<p>This is usually used for placing <tt class="docutils literal"><span class="pre">pygame.USEREVENT</span></tt> events on the queue. -Although any type of event can be placed, if using the sytem event types -your program should be sure to create the standard attributes with -appropriate values.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.event.Event"> -<tt class="descclassname">pygame.event.</tt><tt class="descname">Event</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.event.Event" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create a new event object</span></div> -<div class="line"><span class="signature">Event(type, dict) -> Event</span></div> -<div class="line"><span class="signature">Event(type, **attributes) -> Event</span></div> -</div> -<p>Creates a new event with the given type. The event is created with the given -attributes and values. The attributes can come from a dictionary argument -with string keys, or from keyword arguments. The event object exposes its -dictionary as attribute __dict__, and also as dict for backward -compatibility.</p> -<p>Attributes type, __dict__, and dict are readonly. Other attributes are -mutable. There are no methods attached to an Event object.</p> -<p>Mutable attributes are new to Pygame 1.9.2.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="examples.html" title="pygame.examples" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="draw.html" title="pygame.draw" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/examples.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,696 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.examples — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.font" href="font.html" /> - <link rel="prev" title="pygame.event" href="event.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.examples"> -<span id="pygame-examples"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.examples</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">module of example programs</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="37%" /> -<col width="1%" /> -<col width="62%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.aliens.main">pygame.examples.aliens.main</a></td> -<td>—</td> -<td>play the full aliens example</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.oldalien.main">pygame.examples.oldalien.main</a></td> -<td>—</td> -<td>play the original aliens example</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.stars.main">pygame.examples.stars.main</a></td> -<td>—</td> -<td>run a simple starfield example</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.chimp.main">pygame.examples.chimp.main</a></td> -<td>—</td> -<td>hit the moving chimp</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.moveit.main">pygame.examples.moveit.main</a></td> -<td>—</td> -<td>display animated objects on the screen</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.fonty.main">pygame.examples.fonty.main</a></td> -<td>—</td> -<td>run a font rendering example</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.vgrade.main">pygame.examples.vgrade.main</a></td> -<td>—</td> -<td>display a vertical gradient</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.eventlist.main">pygame.examples.eventlist.main</a></td> -<td>—</td> -<td>display pygame events</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.arraydemo.main">pygame.examples.arraydemo.main</a></td> -<td>—</td> -<td>show various surfarray effects</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.sound.main">pygame.examples.sound.main</a></td> -<td>—</td> -<td>load and play a sound</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.sound_array_demos.main">pygame.examples.sound_array_demos.main</a></td> -<td>—</td> -<td>play various sndarray effects</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.liquid.main">pygame.examples.liquid.main</a></td> -<td>—</td> -<td>display an animated liquid effect</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.glcube.main">pygame.examples.glcube.main</a></td> -<td>—</td> -<td>display an animated 3D cube using OpenGL</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.scrap_clipboard.main">pygame.examples.scrap_clipboard.main</a></td> -<td>—</td> -<td>access the clipboard</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.mask.main">pygame.examples.mask.main</a></td> -<td>—</td> -<td>display multiple images bounce off each other using collision detection</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.testsprite.main">pygame.examples.testsprite.main</a></td> -<td>—</td> -<td>show lots of sprites moving around</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.headless_no_windows_needed.main">pygame.examples.headless_no_windows_needed.main</a></td> -<td>—</td> -<td>write an image file that is smoothscaled copy of an input file</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.fastevents.main">pygame.examples.fastevents.main</a></td> -<td>—</td> -<td>stress test the fastevents module</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.overlay.main">pygame.examples.overlay.main</a></td> -<td>—</td> -<td>play a .pgm video using overlays</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.blend_fill.main">pygame.examples.blend_fill.main</a></td> -<td>—</td> -<td>demonstrate the various surface.fill method blend options</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.blit_blends.main">pygame.examples.blit_blends.main</a></td> -<td>—</td> -<td>uses alternative additive fill to that of surface.fill</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.cursors.main">pygame.examples.cursors.main</a></td> -<td>—</td> -<td>display two different custom cursors</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.pixelarray.main">pygame.examples.pixelarray.main</a></td> -<td>—</td> -<td>display various pixelarray generated effects</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.scaletest.main">pygame.examples.scaletest.main</a></td> -<td>—</td> -<td>interactively scale an image using smoothscale</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.midi.main">pygame.examples.midi.main</a></td> -<td>—</td> -<td>run a midi example</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.scroll.main">pygame.examples.scroll.main</a></td> -<td>—</td> -<td>run a Surface.scroll example that shows a magnified image</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.movieplayer.main">pygame.examples.movieplayer.main</a></td> -<td>—</td> -<td>play an MPEG movie</td> -</tr> -<tr><td><a class="toc reference external" href="examples.html#pygame.examples.camera.main">pygame.examples.camera.main</a></td> -<td>—</td> -<td>display video captured live from an attached camera</td> -</tr> -</tbody> -</table> -<p>These examples should help get you started with pygame. Here is a brief rundown -of what you get. The source code for these examples is in the public domain. -Feel free to use for your own projects.</p> -<p>There are several ways to run the examples. First they can be run as -stand-alone programs. Second they can be imported and their <tt class="docutils literal"><span class="pre">main()</span></tt> methods -called (see below). Finally, the easiest way is to use the python -m option:</p> -<div class="highlight-python"><pre>python -m pygame.examples.<example name> <example arguments></pre> -</div> -<p>eg:</p> -<div class="highlight-python"><pre>python -m pygame.examples.scaletest someimage.png</pre> -</div> -<p>Resources such as images and sounds for the examples are found in the -pygame/examples/data subdirectory.</p> -<p>You can find where the example files are installed by using the following -commands inside the python interpreter.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">pygame.examples.scaletest</span> -<span class="gp">>>> </span><span class="n">pygame</span><span class="o">.</span><span class="n">examples</span><span class="o">.</span><span class="n">scaletest</span><span class="o">.</span><span class="n">__file__</span> -<span class="go">'/usr/lib/python2.6/site-packages/pygame/examples/scaletest.py'</span> -</pre></div> -</div> -<p>On each OS and version of python the location will be slightly different. -For example on windows it might be in ‘C:/Python26/Lib/site-packages/pygame/examples/’ -On Mac OS X it might be in ‘/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pygame/examples/’</p> -<p>You can also run the examples in the python interpreter by calling each modules main() function.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">pygame.examples.scaletest</span> -<span class="gp">>>> </span><span class="n">pygame</span><span class="o">.</span><span class="n">examples</span><span class="o">.</span><span class="n">scaletest</span><span class="o">.</span><span class="n">main</span><span class="p">()</span> -</pre></div> -</div> -<p>We’re always on the lookout for more examples and/or example requests. Code -like this is probably the best way to start getting involved with python -gaming.</p> -<p>examples as a package is new to pygame 1.9.0. But most of the examples came with -pygame much earlier.</p> -<dl class="definition function"> -<dt class="title" id="pygame.examples.aliens.main"> -<tt class="descclassname">aliens.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.aliens.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">play the full aliens example</span></div> -<div class="line"><span class="signature">aliens.main() -> None</span></div> -</div> -<p>This started off as a port of the <tt class="docutils literal"><span class="pre">SDL</span></tt> demonstration, Aliens. Now it has -evolved into something sort of resembling fun. This demonstrates a lot of -different uses of sprites and optimized blitting. Also transparency, -colorkeys, fonts, sound, music, joystick, and more. (PS, my high score is -117! goodluck)</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.oldalien.main"> -<tt class="descclassname">oldalien.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.oldalien.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">play the original aliens example</span></div> -<div class="line"><span class="signature">oldalien.main() -> None</span></div> -</div> -<p>This more closely resembles a port of the <tt class="docutils literal"><span class="pre">SDL</span></tt> Aliens demo. The code is a -lot simpler, so it makes a better starting point for people looking at code -for the first times. These blitting routines are not as optimized as they -should/could be, but the code is easier to follow, and it plays quick -enough.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.stars.main"> -<tt class="descclassname">stars.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.stars.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">run a simple starfield example</span></div> -<div class="line"><span class="signature">stars.main() -> None</span></div> -</div> -<p>A simple starfield example. You can change the center of perspective by -leftclicking the mouse on the screen.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.chimp.main"> -<tt class="descclassname">chimp.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.chimp.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">hit the moving chimp</span></div> -<div class="line"><span class="signature">chimp.main() -> None</span></div> -</div> -<p>This simple example is derived from the line-by-line tutorial that comes -with pygame. It is based on a ‘popular’ web banner. Note there are comments -here, but for the full explanation, follow along in the tutorial.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.moveit.main"> -<tt class="descclassname">moveit.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.moveit.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display animated objects on the screen</span></div> -<div class="line"><span class="signature">moveit.main() -> None</span></div> -</div> -<p>This is the full and final example from the Pygame Tutorial, “How Do I Make -It Move”. It creates 10 objects and animates them on the screen.</p> -<p>Note it’s a bit scant on error checking, but it’s easy to read. :] -Fortunately, this is python, and we needn’t wrestle with a pile of error -codes.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.fonty.main"> -<tt class="descclassname">fonty.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.fonty.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">run a font rendering example</span></div> -<div class="line"><span class="signature">fonty.main() -> None</span></div> -</div> -<p>Super quick, super simple application demonstrating the different ways to -render fonts with the font module</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.vgrade.main"> -<tt class="descclassname">vgrade.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.vgrade.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display a vertical gradient</span></div> -<div class="line"><span class="signature">vgrade.main() -> None</span></div> -</div> -<p>Demonstrates creating a vertical gradient with pixelcopy and NumPy python. -The app will create a new gradient every half second and report the time -needed to create and display the image. If you’re not prepared to start -working with the NumPy arrays, don’t worry about the source for this one :]</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.eventlist.main"> -<tt class="descclassname">eventlist.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.eventlist.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display pygame events</span></div> -<div class="line"><span class="signature">eventlist.main() -> None</span></div> -</div> -<p>Eventlist is a sloppy style of pygame, but is a handy tool for learning -about pygame events and input. At the top of the screen are the state of -several device values, and a scrolling list of events are displayed on the -bottom.</p> -<p>This is not quality ‘ui’ code at all, but you can see how to implement very -non-interactive status displays, or even a crude text output control.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.arraydemo.main"> -<tt class="descclassname">arraydemo.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.arraydemo.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">show various surfarray effects</span></div> -<div class="line"><span class="signature">arraydemo.main(arraytype=None) -> None</span></div> -</div> -<p>Another example filled with various surfarray effects. It requires the -surfarray and image modules to be installed. This little demo can also make -a good starting point for any of your own tests with surfarray</p> -<p>If arraytype is provided then use that array package. Valid values are -‘numeric’ or ‘numpy’. Otherwise default to NumPy, or fall back on Numeric if -NumPy is not installed. As a program <tt class="docutils literal"><span class="pre">surfarray.py</span></tt> accepts an optional -–numeric or –numpy flag. (New pygame 1.9.0)</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.sound.main"> -<tt class="descclassname">sound.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.sound.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">load and play a sound</span></div> -<div class="line"><span class="signature">sound.main(file_path=None) -> None</span></div> -</div> -<p>Extremely basic testing of the mixer module. Load a sound and play it. All -from the command shell, no graphics.</p> -<p>If provided, use the audio file ‘file_path’, otherwise use a default file.</p> -<p><tt class="docutils literal"><span class="pre">sound.py</span></tt> optional command line argument: an audio file</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.sound_array_demos.main"> -<tt class="descclassname">sound_array_demos.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.sound_array_demos.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">play various sndarray effects</span></div> -<div class="line"><span class="signature">sound_array_demos.main(arraytype=None) -> None</span></div> -</div> -<p>If arraytype is provided then use that array package. Valid values are -‘numeric’ or ‘numpy’. Otherwise default to NumPy, or fall back on Numeric if -NumPy is not installed.</p> -<p>Uses sndarray and NumPy ( or Numeric) to create offset faded copies of the -original sound. Currently it just uses hardcoded values for the number of -echos and the delay. Easy for you to recreate as needed. Run as a program -<tt class="docutils literal"><span class="pre">sound_array_demos.py</span></tt> takes an optional command line option, –numpy or -–numeric, specifying which array package to use.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.liquid.main"> -<tt class="descclassname">liquid.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.liquid.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display an animated liquid effect</span></div> -<div class="line"><span class="signature">liquid.main() -> None</span></div> -</div> -<p>This example was created in a quick comparison with the BlitzBasic gaming -language. Nonetheless, it demonstrates a quick 8-bit setup (with colormap).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.glcube.main"> -<tt class="descclassname">glcube.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.glcube.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display an animated 3D cube using OpenGL</span></div> -<div class="line"><span class="signature">glcube.main() -> None</span></div> -</div> -<p>Using PyOpenGL and pygame, this creates a spinning 3D multicolored cube.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.scrap_clipboard.main"> -<tt class="descclassname">scrap_clipboard.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.scrap_clipboard.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">access the clipboard</span></div> -<div class="line"><span class="signature">scrap_clipboard.main() -> None</span></div> -</div> -<p>A simple demonstration example for the clipboard support.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.mask.main"> -<tt class="descclassname">mask.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.mask.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display multiple images bounce off each other using collision detection</span></div> -<div class="line"><span class="signature">mask.main(*args) -> None</span></div> -</div> -<p>Positional arguments:</p> -<div class="highlight-python"><pre>one or more image file names.</pre> -</div> -<p>This <tt class="docutils literal"><span class="pre">pygame.masks</span></tt> demo will display multiple moving sprites bouncing off -each other. More than one sprite image can be provided.</p> -<p>If run as a program then <tt class="docutils literal"><span class="pre">mask.py</span></tt> takes one or more image files as -command line arguments.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.testsprite.main"> -<tt class="descclassname">testsprite.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.testsprite.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">show lots of sprites moving around</span></div> -<div class="line"><span class="signature">testsprite.main(update_rects = True, use_static = False, use_FastRenderGroup = False, screen_dims = [640, 480], use_alpha = False, flags = 0) -> None</span></div> -</div> -<p>Optional keyword arguments:</p> -<div class="highlight-python"><pre>update_rects - use the RenderUpdate sprite group class -use_static - include non-moving images -use_FastRenderGroup - Use the FastRenderGroup sprite group -screen_dims - pygame window dimensions -use_alpha - use alpha blending -flags - additional display mode flags</pre> -</div> -<p>Like the <tt class="docutils literal"><span class="pre">testsprite.c</span></tt> that comes with sdl, this pygame version shows -lots of sprites moving around.</p> -<p>If run as a stand-alone program then no command line arguments are taken.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.headless_no_windows_needed.main"> -<tt class="descclassname">headless_no_windows_needed.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.headless_no_windows_needed.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">write an image file that is smoothscaled copy of an input file</span></div> -<div class="line"><span class="signature">headless_no_windows_needed.main(fin, fout, w, h) -> None</span></div> -</div> -<p>arguments:</p> -<div class="highlight-python"><pre>fin - name of an input image file -fout - name of the output file to create/overwrite -w, h - size of the rescaled image, as integer width and height</pre> -</div> -<p>How to use pygame with no windowing system, like on headless servers.</p> -<p>Thumbnail generation with scaling is an example of what you can do with -pygame.</p> -<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>: the pygame scale function uses mmx/sse if available, and can be -run in multiple threads.</p> -<p>If <tt class="docutils literal"><span class="pre">headless_no_windows_needed.py</span></tt> is run as a program it takes the -following command line arguments:</p> -<div class="highlight-python"><pre>-scale inputimage outputimage new_width new_height -eg. -scale in.png outpng 50 50</pre> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.fastevents.main"> -<tt class="descclassname">fastevents.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.fastevents.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stress test the fastevents module</span></div> -<div class="line"><span class="signature">fastevents.main() -> None</span></div> -</div> -<p>This is a stress test for the fastevents module.</p> -<blockquote> -<ul class="simple"> -<li>Fast events does not appear faster!</li> -<li></li> -</ul> -</blockquote> -<p>So far it looks like normal <a class="tooltip reference internal" href="event.html#module-pygame.event" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.event</span></tt><span class="tooltip-content">pygame module for interacting with events and queues</span></a> is faster by up to two -times. So maybe fastevent isn’t fast at all.</p> -<p>Tested on windowsXP sp2 athlon, and freebsd.</p> -<p>However... on my debian duron 850 machine fastevents is faster.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.overlay.main"> -<tt class="descclassname">overlay.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.overlay.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">play a .pgm video using overlays</span></div> -<div class="line"><span class="signature">overlay.main(fname) -> None</span></div> -</div> -<p>Play the .pgm video fila a path fname.</p> -<p>If run as a program <tt class="docutils literal"><span class="pre">overlay.py</span></tt> takes the file name as a command line -argument.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.blend_fill.main"> -<tt class="descclassname">blend_fill.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.blend_fill.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">demonstrate the various surface.fill method blend options</span></div> -<div class="line"><span class="signature">blend_fill.main() -> None</span></div> -</div> -<p>A interactive demo that lets one choose which BLEND_xxx option to apply to a -surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.blit_blends.main"> -<tt class="descclassname">blit_blends.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.blit_blends.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uses alternative additive fill to that of surface.fill</span></div> -<div class="line"><span class="signature">blit_blends.main() -> None</span></div> -</div> -<p>Fake additive blending. Using NumPy. it doesn’t clamp. Press r,g,b Somewhat -like blend_fill.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.cursors.main"> -<tt class="descclassname">cursors.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.cursors.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display two different custom cursors</span></div> -<div class="line"><span class="signature">cursors.main() -> None</span></div> -</div> -<p>Display an arrow or circle with crossbar cursor.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.pixelarray.main"> -<tt class="descclassname">pixelarray.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.pixelarray.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display various pixelarray generated effects</span></div> -<div class="line"><span class="signature">pixelarray.main() -> None</span></div> -</div> -<p>Display various pixelarray generated effects.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.scaletest.main"> -<tt class="descclassname">scaletest.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.scaletest.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">interactively scale an image using smoothscale</span></div> -<div class="line"><span class="signature">scaletest.main(imagefile, convert_alpha=False, run_speed_test=True) -> None</span></div> -</div> -<p>arguments:</p> -<div class="highlight-python"><pre>imagefile - file name of source image (required) -convert_alpha - use convert_alpha() on the surf (default False) -run_speed_test - (default False)</pre> -</div> -<p>A smoothscale example that resized an image on the screen. Vertical and -horizontal arrow keys are used to change the width and height of the -displayed image. If the convert_alpha option is True then the source image -is forced to have source alpha, whether or not the original images does. If -run_speed_test is True then a background timing test is performed instead of -the interactive scaler.</p> -<p>If <tt class="docutils literal"><span class="pre">scaletest.py</span></tt> is run as a program then the command line options are:</p> -<div class="highlight-python"><pre>ImageFile [-t] [-convert_alpha] -[-t] = Run Speed Test -[-convert_alpha] = Use convert_alpha() on the surf.</pre> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.midi.main"> -<tt class="descclassname">midi.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.midi.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">run a midi example</span></div> -<div class="line"><span class="signature">midi.main(mode=’output’, device_id=None) -> None</span></div> -</div> -<p>Arguments:</p> -<div class="highlight-python"><pre>mode - if 'output' run a midi keyboard output example - 'input' run a midi event logger input example - 'list' list available midi devices - (default 'output') -device_id - midi device number; if None then use the default midi input or - output device for the system</pre> -</div> -<p>The output example shows how to translate mouse clicks or computer keyboard -events into midi notes. It implements a rudimentary button widget and state -machine.</p> -<p>The input example shows how to translate midi input to pygame events.</p> -<p>With the use of a virtual midi patch cord the output and input examples can -be run as separate processes and connected so the keyboard output is -displayed on a console.</p> -<p>new to pygame 1.9.0</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.scroll.main"> -<tt class="descclassname">scroll.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.scroll.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">run a Surface.scroll example that shows a magnified image</span></div> -<div class="line"><span class="signature">scroll.main(image_file=None) -> None</span></div> -</div> -<p>This example shows a scrollable image that has a zoom factor of eight. It -uses the <tt class="xref py py-func docutils literal"><span class="pre">Surface.scroll()</span></tt> function to shift the image on the display -surface. A clip rectangle protects a margin area. If called as a function, -the example accepts an optional image file path. If run as a program it -takes an optional file path command line argument. If no file is provided a -default image file is used.</p> -<p>When running click on a black triangle to move one pixel in the direction -the triangle points. Or use the arrow keys. Close the window or press -<tt class="docutils literal"><span class="pre">ESC</span></tt> to quit.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.movieplayer.main"> -<tt class="descclassname">movieplayer.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.movieplayer.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">play an MPEG movie</span></div> -<div class="line"><span class="signature">movieplayer.main(filepath) -> None</span></div> -</div> -<p>A simple movie player that plays an <tt class="docutils literal"><span class="pre">MPEG</span></tt> movie in a Pygame window. It -showcases the <a class="tooltip reference internal" href="movie.html#module-pygame.movie" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.movie</span></tt><span class="tooltip-content">pygame module for playback of mpeg video</span></a> module. The window adjusts to the size of -the movie image. It is given a border to demonstrate that a movie can play -autonomously in a sub- window. Also, the file is copied to a file like -object to show that not just Python files can be used as a movie source.</p> -<p>The <a class="tooltip reference internal" href="movie.html#module-pygame.movie" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.movie</span></tt><span class="tooltip-content">pygame module for playback of mpeg video</span></a> module is problematic and may not work on all -systems. It is intended to replace it with an ffmpeg based version.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.examples.camera.main"> -<tt class="descclassname">camera.</tt><tt class="descname">main</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.examples.camera.main" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">display video captured live from an attached camera</span></div> -<div class="line"><span class="signature">camera.main() -> None</span></div> -</div> -<p>A simple live video player, it uses the first available camera it finds on -the system.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="font.html" title="pygame.font" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="event.html" title="pygame.event" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/font.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,550 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.font — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.freetype" href="freetype.html" /> - <link rel="prev" title="pygame.examples" href="examples.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.font"> -<span id="pygame-font"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.font</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for loading and rendering fonts</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="36%" /> -<col width="1%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="font.html#pygame.font.init">pygame.font.init</a></td> -<td>—</td> -<td>initialize the font module</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.quit">pygame.font.quit</a></td> -<td>—</td> -<td>uninitialize the font module</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.get_init">pygame.font.get_init</a></td> -<td>—</td> -<td>true if the font module is initialized</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.get_default_font">pygame.font.get_default_font</a></td> -<td>—</td> -<td>get the filename of the default font</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.get_fonts">pygame.font.get_fonts</a></td> -<td>—</td> -<td>get all available fonts</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.match_font">pygame.font.match_font</a></td> -<td>—</td> -<td>find a specific font on the system</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.SysFont">pygame.font.SysFont</a></td> -<td>—</td> -<td>create a Font object from the system fonts</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font">pygame.font.Font</a></td> -<td>—</td> -<td>create a new Font object from a file</td> -</tr> -</tbody> -</table> -<p>The font module allows for rendering TrueType fonts into a new Surface object. -It accepts any UCS-2 character (‘u0001’ to ‘uFFFF’). This module is optional -and requires SDL_ttf as a dependency. You should test that <a class="tooltip reference internal" href="#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a> -is available and initialized before attempting to use the module.</p> -<p>Most of the work done with fonts are done by using the actual Font objects. The -module by itself only has routines to initialize the module and create Font -objects with <tt class="docutils literal"><span class="pre">pygame.font.Font()</span></tt>.</p> -<p>You can load fonts from the system by using the <tt class="docutils literal"><span class="pre">pygame.font.SysFont()</span></tt> -function. There are a few other functions to help lookup the system fonts.</p> -<p>Pygame comes with a builtin default font. This can always be accessed by -passing None as the font name.</p> -<p>To use the <a class="tooltip reference internal" href="freetype.html#module-pygame.freetype" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.freetype</span></tt><span class="tooltip-content">Enhanced Pygame module for loading and rendering computer fonts</span></a> based <tt class="xref py py-mod docutils literal"><span class="pre">pygame.ftfont</span></tt> as -<a class="tooltip reference internal" href="#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a> define the enviroment variable PYGAME_FREETYPE before the -first import of <a class="tooltip reference internal" href="pygame.html#module-pygame" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame</span></tt><span class="tooltip-content">the top level pygame package</span></a>. <tt class="xref py py-mod docutils literal"><span class="pre">pygame.ftfont</span></tt> is a <a class="tooltip reference internal" href="#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a> -compatible module that passes all but one of the font module unit tests: -it does not have the UCS-2 limitation of the SDL_ttf based font module, so -fails to raise an exception for a code point greater than ‘uFFFF’. If -<a class="tooltip reference internal" href="freetype.html#module-pygame.freetype" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.freetype</span></tt><span class="tooltip-content">Enhanced Pygame module for loading and rendering computer fonts</span></a> is unavailable then the SDL_ttf font module will be -loaded instead.</p> -<dl class="definition function"> -<dt class="title" id="pygame.font.init"> -<tt class="descclassname">pygame.font.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize the font module</span></div> -<div class="line"><span class="signature">init() -> None</span></div> -</div> -<p>This method is called automatically by <tt class="docutils literal"><span class="pre">pygame.init()</span></tt>. It initializes the -font module. The module must be initialized before any other functions will -work.</p> -<p>It is safe to call this function more than once.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.font.quit"> -<tt class="descclassname">pygame.font.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize the font module</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>Manually uninitialize SDL_ttf’s font system. This is called automatically by -<tt class="docutils literal"><span class="pre">pygame.quit()</span></tt>.</p> -<p>It is safe to call this function even if font is currently not initialized.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.font.get_init"> -<tt class="descclassname">pygame.font.</tt><tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.get_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the font module is initialized</span></div> -<div class="line"><span class="signature">get_init() -> bool</span></div> -</div> -<p>Test if the font module is initialized or not.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.font.get_default_font"> -<tt class="descclassname">pygame.font.</tt><tt class="descname">get_default_font</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.get_default_font" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the filename of the default font</span></div> -<div class="line"><span class="signature">get_default_font() -> string</span></div> -</div> -<p>Return the filename of the system font. This is not the full path to the -file. This file can usually be found in the same directory as the font -module, but it can also be bundled in separate archives.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.font.get_fonts"> -<tt class="descclassname">pygame.font.</tt><tt class="descname">get_fonts</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.get_fonts" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get all available fonts</span></div> -<div class="line"><span class="signature">get_fonts() -> list of strings</span></div> -</div> -<p>Returns a list of all the fonts available on the system. The names of the -fonts will be set to lowercase with all spaces and punctuation removed. This -works on most systems, but some will return an empty list if they cannot -find fonts.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.font.match_font"> -<tt class="descclassname">pygame.font.</tt><tt class="descname">match_font</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.match_font" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find a specific font on the system</span></div> -<div class="line"><span class="signature">match_font(name, bold=False, italic=False) -> path</span></div> -</div> -<p>Returns the full path to a font file on the system. If bold or italic are -set to true, this will attempt to find the correct family of font.</p> -<p>The font name can actually be a comma separated list of font names to try. -If none of the given names are found, None is returned.</p> -<p>Example:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">print</span> <span class="n">pygame</span><span class="o">.</span><span class="n">font</span><span class="o">.</span><span class="n">match_font</span><span class="p">(</span><span class="s">'bitstreamverasans'</span><span class="p">)</span> -<span class="c"># output is: /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf</span> -<span class="c"># (but only if you have Vera on your system)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.font.SysFont"> -<tt class="descclassname">pygame.font.</tt><tt class="descname">SysFont</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.SysFont" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create a Font object from the system fonts</span></div> -<div class="line"><span class="signature">SysFont(name, size, bold=False, italic=False) -> Font</span></div> -</div> -<p>Return a new Font object that is loaded from the system fonts. The font will -match the requested bold and italic flags. If a suitable system font is not -found this will fallback on loading the default pygame font. The font name -can be a comma separated list of font names to look for.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.font.Font"> -<em class="property">class </em><tt class="descclassname">pygame.font.</tt><tt class="descname">Font</tt><a class="headerlink" href="#pygame.font.Font" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create a new Font object from a file</span></div> -<div class="line"><span class="signature">Font(filename, size) -> Font</span></div> -<div class="line"><span class="signature">Font(object, size) -> Font</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="32%" /> -<col width="1%" /> -<col width="67%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.render">pygame.font.Font.render</a></td> -<td>—</td> -<td>draw text on a new Surface</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.size">pygame.font.Font.size</a></td> -<td>—</td> -<td>determine the amount of space needed to render text</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.set_underline">pygame.font.Font.set_underline</a></td> -<td>—</td> -<td>control if text is rendered with an underline</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_underline">pygame.font.Font.get_underline</a></td> -<td>—</td> -<td>check if text will be rendered with an underline</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.set_bold">pygame.font.Font.set_bold</a></td> -<td>—</td> -<td>enable fake rendering of bold text</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_bold">pygame.font.Font.get_bold</a></td> -<td>—</td> -<td>check if text will be rendered bold</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.set_italic">pygame.font.Font.set_italic</a></td> -<td>—</td> -<td>enable fake rendering of italic text</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.metrics">pygame.font.Font.metrics</a></td> -<td>—</td> -<td>Gets the metrics for each character in the pased string.</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_italic">pygame.font.Font.get_italic</a></td> -<td>—</td> -<td>check if the text will be rendered italic</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_linesize">pygame.font.Font.get_linesize</a></td> -<td>—</td> -<td>get the line space of the font text</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_height">pygame.font.Font.get_height</a></td> -<td>—</td> -<td>get the height of the font</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_ascent">pygame.font.Font.get_ascent</a></td> -<td>—</td> -<td>get the ascent of the font</td> -</tr> -<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_descent">pygame.font.Font.get_descent</a></td> -<td>—</td> -<td>get the descent of the font</td> -</tr> -</tbody> -</table> -<p>Load a new font from a given filename or a python file object. The size is -the height of the font in pixels. If the filename is None the Pygame default -font will be loaded. If a font cannot be loaded from the arguments given an -exception will be raised. Once the font is created the size cannot be -changed.</p> -<p>Font objects are mainly used to render text into new Surface objects. The -render can emulate bold or italic features, but it is better to load from a -font with actual italic or bold glyphs. The rendered text can be regular -strings or unicode.</p> -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.render"> -<tt class="descname">render</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.render" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw text on a new Surface</span></div> -<div class="line"><span class="signature">render(text, antialias, color, background=None) -> Surface</span></div> -</div> -<p>This creates a new Surface with the specified text rendered on it. Pygame -provides no way to directly draw text on an existing Surface: instead you -must use <tt class="docutils literal"><span class="pre">Font.render()</span></tt> to create an image (Surface) of the text, then -blit this image onto another Surface.</p> -<p>The text can only be a single line: newline characters are not rendered. -Null characters (‘x00’) raise a TypeError. Both Unicode and char (byte) -strings are accepted. For Unicode strings only UCS-2 characters (‘u0001’ -to ‘uFFFF’) are recognized. Anything greater raises a UnicodeError. For -char strings a <tt class="docutils literal"><span class="pre">LATIN1</span></tt> encoding is assumed. The antialias argument is -a boolean: if true the characters will have smooth edges. The color -argument is the color of the text [e.g.: (0,0,255) for blue]. The -optional background argument is a color to use for the text background. -If no background is passed the area outside the text will be transparent.</p> -<p>The Surface returned will be of the dimensions required to hold the text. -(the same as those returned by Font.size()). If an empty string is passed -for the text, a blank surface will be returned that is one pixel wide and -the height of the font.</p> -<p>Depending on the type of background and antialiasing used, this returns -different types of Surfaces. For performance reasons, it is good to know -what type of image will be used. If antialiasing is not used, the return -image will always be an 8bit image with a two color palette. If the -background is transparent a colorkey will be set. Antialiased images are -rendered to 24-bit <tt class="docutils literal"><span class="pre">RGB</span></tt> images. If the background is transparent a -pixel alpha will be included.</p> -<p>Optimization: if you know that the final destination for the text (on the -screen) will always have a solid background, and the text is antialiased, -you can improve performance by specifying the background color. This will -cause the resulting image to maintain transparency information by -colorkey rather than (much less efficient) alpha values.</p> -<p>If you render ‘n’ a unknown char will be rendered. Usually a rectangle. -Instead you need to handle new lines yourself.</p> -<p>Font rendering is not thread safe: only a single thread can render text -at any time.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.size"> -<tt class="descname">size</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.size" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">determine the amount of space needed to render text</span></div> -<div class="line"><span class="signature">size(text) -> (width, height)</span></div> -</div> -<p>Returns the dimensions needed to render the text. This can be used to -help determine the positioning needed for text before it is rendered. It -can also be used for wordwrapping and other layout effects.</p> -<p>Be aware that most fonts use kerning which adjusts the widths for -specific letter pairs. For example, the width for “ae” will not always -match the width for “a” + “e”.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.set_underline"> -<tt class="descname">set_underline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.set_underline" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">control if text is rendered with an underline</span></div> -<div class="line"><span class="signature">set_underline(bool) -> None</span></div> -</div> -<p>When enabled, all rendered fonts will include an underline. The underline -is always one pixel thick, regardless of font size. This can be mixed -with the bold and italic modes.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.get_underline"> -<tt class="descname">get_underline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_underline" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if text will be rendered with an underline</span></div> -<div class="line"><span class="signature">get_underline() -> bool</span></div> -</div> -<p>Return True when the font underline is enabled.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.set_bold"> -<tt class="descname">set_bold</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.set_bold" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">enable fake rendering of bold text</span></div> -<div class="line"><span class="signature">set_bold(bool) -> None</span></div> -</div> -<p>Enables the bold rendering of text. This is a fake stretching of the font -that doesn’t look good on many font types. If possible load the font from -a real bold font file. While bold, the font will have a different width -than when normal. This can be mixed with the italic and underline modes.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.get_bold"> -<tt class="descname">get_bold</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_bold" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if text will be rendered bold</span></div> -<div class="line"><span class="signature">get_bold() -> bool</span></div> -</div> -<p>Return True when the font bold rendering mode is enabled.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.set_italic"> -<tt class="descname">set_italic</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.set_italic" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">enable fake rendering of italic text</span></div> -<div class="line"><span class="signature">set_italic(bool) -> None</span></div> -</div> -<p>Enables fake rendering of italic text. This is a fake skewing of the font -that doesn’t look good on many font types. If possible load the font from -a real italic font file. While italic the font will have a different -width than when normal. This can be mixed with the bold and underline -modes.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.metrics"> -<tt class="descname">metrics</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.metrics" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the metrics for each character in the pased string.</span></div> -<div class="line"><span class="signature">metrics(text) -> list</span></div> -</div> -<p>The list contains tuples for each character, which contain the minimum -<tt class="docutils literal"><span class="pre">X</span></tt> offset, the maximum <tt class="docutils literal"><span class="pre">X</span></tt> offset, the minimum <tt class="docutils literal"><span class="pre">Y</span></tt> offset, the -maximum <tt class="docutils literal"><span class="pre">Y</span></tt> offset and the advance offset (bearing plus width) of the -character. [(minx, maxx, miny, maxy, advance), (minx, maxx, miny, maxy, -advance), ...]. None is entered in the list for each unrecognized -character.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.get_italic"> -<tt class="descname">get_italic</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_italic" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the text will be rendered italic</span></div> -<div class="line"><span class="signature">get_italic() -> bool</span></div> -</div> -<p>Return True when the font italic rendering mode is enabled.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.get_linesize"> -<tt class="descname">get_linesize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_linesize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the line space of the font text</span></div> -<div class="line"><span class="signature">get_linesize() -> int</span></div> -</div> -<p>Return the height in pixels for a line of text with the font. When -rendering multiple lines of text this is the recommended amount of space -between lines.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.get_height"> -<tt class="descname">get_height</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_height" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the height of the font</span></div> -<div class="line"><span class="signature">get_height() -> int</span></div> -</div> -<p>Return the height in pixels of the actual rendered text. This is the -average size for each glyph in the font.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.get_ascent"> -<tt class="descname">get_ascent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_ascent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the ascent of the font</span></div> -<div class="line"><span class="signature">get_ascent() -> int</span></div> -</div> -<p>Return the height in pixels for the font ascent. The ascent is the number -of pixels from the font baseline to the top of the font.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.font.Font.get_descent"> -<tt class="descname">get_descent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_descent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the descent of the font</span></div> -<div class="line"><span class="signature">get_descent() -> int</span></div> -</div> -<p>Return the height in pixels for the font descent. The descent is the -number of pixels from the font baseline to the bottom of the font.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="freetype.html" title="pygame.freetype" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="examples.html" title="pygame.examples" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/freetype.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,904 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.freetype — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.gfxdraw" href="gfxdraw.html" /> - <link rel="prev" title="pygame.font" href="font.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.freetype"> -<span id="pygame-freetype"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.freetype</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Enhanced Pygame module for loading and rendering computer fonts</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="37%" /> -<col width="1%" /> -<col width="62%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_error">pygame.freetype.get_error</a></td> -<td>—</td> -<td>Return the latest FreeType2 error</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_version">pygame.freetype.get_version</a></td> -<td>—</td> -<td>Return the FreeType 2 version</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.init">pygame.freetype.init</a></td> -<td>—</td> -<td>Initialize the underlying FreeType 2 library.</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.quit">pygame.freetype.quit</a></td> -<td>—</td> -<td>Shut down the underlying FreeType 2 library.</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.was_init">pygame.freetype.was_init</a></td> -<td>—</td> -<td>Return whether the the FreeType 2 library is initialized.</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_default_resolution">pygame.freetype.get_default_resolution</a></td> -<td>—</td> -<td>Return the default pixel size in dots per inch</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.set_default_resolution">pygame.freetype.set_default_resolution</a></td> -<td>—</td> -<td>Set the default pixel size in dots per inch for the module</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_default_font">pygame.freetype.get_default_font</a></td> -<td>—</td> -<td>Get the filename of the default font</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font">pygame.freetype.Font</a></td> -<td>—</td> -<td>Create a new Font instance from a supported font file.</td> -</tr> -</tbody> -</table> -<p>— Note that some features may change before a formal release</p> -<p>The <a class="tooltip reference internal" href="#module-pygame.freetype" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.freetype</span></tt><span class="tooltip-content">Enhanced Pygame module for loading and rendering computer fonts</span></a> module allows for the rendering of all font file formats -supported by FreeType, namely <tt class="docutils literal"><span class="pre">TTF</span></tt>, Type1, <tt class="docutils literal"><span class="pre">CFF</span></tt>, OpenType, <tt class="docutils literal"><span class="pre">SFNT</span></tt>, <tt class="docutils literal"><span class="pre">PCF</span></tt>, -<tt class="docutils literal"><span class="pre">FNT</span></tt>, <tt class="docutils literal"><span class="pre">BDF</span></tt>, <tt class="docutils literal"><span class="pre">PFR</span></tt> and Type42 fonts. It can render any UTF-32 character in a -font file.</p> -<p>This module is a replacement for <a class="tooltip reference internal" href="font.html#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a>. It has all of the functionality -of the original, plus many new features. Yet is has absolutely no dependencies -on the SDL_ttf library. The <a class="tooltip reference internal" href="#module-pygame.freetype" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.freetype</span></tt><span class="tooltip-content">Enhanced Pygame module for loading and rendering computer fonts</span></a> module is not itself backward -compatible with <a class="tooltip reference internal" href="font.html#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a>. Instead, a new <tt class="xref py py-mod docutils literal"><span class="pre">pygame.ftfont</span></tt> provides -a drop-in replacement for <a class="tooltip reference internal" href="font.html#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a>.</p> -<p>Most of the work done with fonts is done by using the actual Font objects. The -module by itself only has routines to initialize itself and create Font objects -with <tt class="docutils literal"><span class="pre">pygame.freetype.Font()</span></tt>.</p> -<p>You can load fonts from the system by using the <tt class="docutils literal"><span class="pre">pygame.freetype.SysFont()</span></tt> -function. There are a few other functions to help find system fonts.</p> -<p>For now undefined character codes are replaced with the <tt class="docutils literal"><span class="pre">undefined</span> <span class="pre">character</span></tt>. -How undefined codes are handled may become configurable in a future release.</p> -<p>Pygame comes with a builtin default font. This can always be accessed by -passing None as the font name to the Font constructor.</p> -<p>New in Pygame 1.9.2</p> -<dl class="definition function"> -<dt class="title" id="pygame.freetype.get_error"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_error</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_error" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return the latest FreeType2 error</span></div> -<div class="line"><span class="signature">get_error() -> str</span></div> -</div> -<p>Return a description of the last error which occurred in the FreeType2 -library, or None if no errors have occurred.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.freetype.get_version"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_version</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_version" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return the FreeType 2 version</span></div> -<div class="line"><span class="signature">get_version() -> (int, int, int)</span></div> -</div> -<p>Returns the version of the FreeType2 library which was used to build the -‘freetype’ module.</p> -<p>Note that the freetype module depends on the FreeType 2 library. It will -not compile with the original FreeType 1.0. Hence, the first element of the -tuple will always be “2”.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.freetype.init"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Initialize the underlying FreeType 2 library.</span></div> -<div class="line"><span class="signature">init(cache_size=64, resolution=72) -> None</span></div> -</div> -<p>This function initializes the underlying FreeType 2 library and must be -called before trying to use any of the functionality of the ‘freetype’ -module.</p> -<p>However, this function will be automatically called by <tt class="docutils literal"><span class="pre">pygame.init()</span></tt>. -It is safe to call this function more than once.</p> -<p>Optionally, you may specify a default size for the Glyph cache: this is the -maximum number of glyphs that will be cached at any given time by the -module. Exceedingly small values will be automatically tuned for -performance. Also a default pixel resolution, in dots per inch, can -be given to adjust font scaling.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.freetype.quit"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Shut down the underlying FreeType 2 library.</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>This function de-initializes the <tt class="docutils literal"><span class="pre">freetype</span></tt> module. After calling this -function, you should not invoke any class, method or function related to the -<tt class="docutils literal"><span class="pre">freetype</span></tt> module as they are likely to fail or might give unpredictable -results. It is safe to call this function even if the module hasn’t been -initialized yet.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.freetype.was_init"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">was_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.was_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return whether the the FreeType 2 library is initialized.</span></div> -<div class="line"><span class="signature">was_init() -> bool</span></div> -</div> -<p>Returns whether the the FreeType 2 library is initialized.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.freetype.get_default_resolution"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_default_resolution</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_default_resolution" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return the default pixel size in dots per inch</span></div> -<div class="line"><span class="signature">get_default_resolution() -> long</span></div> -</div> -<p>Returns the default pixel size, in dots per inch for the module. If not changed -it will be 72.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.freetype.set_default_resolution"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">set_default_resolution</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.set_default_resolution" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Set the default pixel size in dots per inch for the module</span></div> -<div class="line"><span class="signature">set_default_resolution([resolution]) -> None</span></div> -</div> -<p>Set the default pixel size, in dots per inch, for the module. If the -optional argument is omitted or zero the resolution is reset to 72.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.freetype.get_default_font"> -<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_default_font</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_default_font" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Get the filename of the default font</span></div> -<div class="line"><span class="signature">get_default_font() -> string</span></div> -</div> -<p>Return the filename of the system font. This is not the full path to the -file. This file can usually be found in the same directory as the font -module, but it can also be bundled in separate archives.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.freetype.Font"> -<em class="property">class </em><tt class="descclassname">pygame.freetype.</tt><tt class="descname">Font</tt><a class="headerlink" href="#pygame.freetype.Font" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Create a new Font instance from a supported font file.</span></div> -<div class="line"><span class="signature">Font(file, style=STYLE_NONE, ptsize=-1, font_index=0, vertical=0, ucs4=0, resolution=0) -> Font</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="39%" /> -<col width="1%" /> -<col width="60%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.name">pygame.freetype.Font.name</a></td> -<td>—</td> -<td>Proper font name.</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.path">pygame.freetype.Font.path</a></td> -<td>—</td> -<td>Font file path</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.get_rect">pygame.freetype.Font.get_rect</a></td> -<td>—</td> -<td>Return the size and offset of rendered text</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.get_metrics">pygame.freetype.Font.get_metrics</a></td> -<td>—</td> -<td>Return the glyph metrics for the given text</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.height">pygame.freetype.Font.height</a></td> -<td>—</td> -<td>The unscaled height of the font in font units</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.ascender">pygame.freetype.Font.ascender</a></td> -<td>—</td> -<td>The unscaled ascent of the font in font units</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.descender">pygame.freetype.Font.descender</a></td> -<td>—</td> -<td>The unscaled descent of the font in font units</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.get_sized_ascender">pygame.freetype.Font.get_sized_ascender</a></td> -<td>—</td> -<td>The scaled ascent of the font in pixels</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.get_sized_descender">pygame.freetype.Font.get_sized_descender</a></td> -<td>—</td> -<td>The scaled descent of the font in pixels</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.get_sized_height">pygame.freetype.Font.get_sized_height</a></td> -<td>—</td> -<td>The scaled height of the font in pixels</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.get_sized_glyph_height">pygame.freetype.Font.get_sized_glyph_height</a></td> -<td>—</td> -<td>The scaled bounding box height of the font in pixels</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.render">pygame.freetype.Font.render</a></td> -<td>—</td> -<td>Return rendered text as a surface</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.render_to">pygame.freetype.Font.render_to</a></td> -<td>—</td> -<td>Render text onto an existing surface</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.render_raw">pygame.freetype.Font.render_raw</a></td> -<td>—</td> -<td>Return rendered text as a string of bytes</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.render_raw_to">pygame.freetype.Font.render_raw_to</a></td> -<td>—</td> -<td>Render text into an array of ints</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.style">pygame.freetype.Font.style</a></td> -<td>—</td> -<td>The font’s style flags</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.underline">pygame.freetype.Font.underline</a></td> -<td>—</td> -<td>The state of the font’s underline style flag</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.strong">pygame.freetype.Font.strong</a></td> -<td>—</td> -<td>The state of the font’s strong style flag</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.oblique">pygame.freetype.Font.oblique</a></td> -<td>—</td> -<td>The state of the font’s oblique style flag</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.wide">pygame.freetype.Font.wide</a></td> -<td>—</td> -<td>The state of the font’s wide style flag</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.strength">pygame.freetype.Font.strength</a></td> -<td>—</td> -<td>The strength associated with the strong or wide font styles</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.underline_adjustment">pygame.freetype.Font.underline_adjustment</a></td> -<td>—</td> -<td>Adjustment factor for the underline position</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.fixed_width">pygame.freetype.Font.fixed_width</a></td> -<td>—</td> -<td>Gets whether the font is fixed-width</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.antialiased">pygame.freetype.Font.antialiased</a></td> -<td>—</td> -<td>Font anti-aliasing mode</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.kerning">pygame.freetype.Font.kerning</a></td> -<td>—</td> -<td>Character kerning mode</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.vertical">pygame.freetype.Font.vertical</a></td> -<td>—</td> -<td>Font vertical mode</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.origin">pygame.freetype.Font.origin</a></td> -<td>—</td> -<td>Font render to text origin mode</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.pad">pygame.freetype.Font.pad</a></td> -<td>—</td> -<td>padded boundary mode</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.ucs4">pygame.freetype.Font.ucs4</a></td> -<td>—</td> -<td>Enable UCS-4 mode</td> -</tr> -<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Font.resolution">pygame.freetype.Font.resolution</a></td> -<td>—</td> -<td>Pixel resolution in dots per inch</td> -</tr> -</tbody> -</table> -<p>Argument <em>file</em> can be either a string representing the font’s filename, a -file-like object containing the font, or None; if None, the default, built-in font -is used.</p> -<p>Optionally, a <em>ptsize</em> argument may be specified to set the default size in -points, which will be used when rendering the font. The size can also be -passed explicitly to each method call. Because of the way the caching -system works, specifying a default size on the constructor doesn’t imply a -performance gain over manually passing the size on each function call.</p> -<p>If the font file has more than one font, the font to load can be chosen with -the <em>index</em> argument. An exception is raised for an out-of-range font index -value.</p> -<p>The <em>style</em> argument will set the default style (oblique, underline, strong) -used to draw this font. This style may be overridden on any <a class="reference internal" href="#pygame.freetype.Font.render" title="pygame.freetype.Font.render"><tt class="xref py py-meth docutils literal"><span class="pre">Font.render()</span></tt></a> -call.</p> -<p>The optional vertical argument, an integer, sets the default orientation -for the font: 0 (False) for horizontal, any other value (True) for vertical. -See <a class="reference internal" href="#pygame.freetype.Font.vertical" title="pygame.freetype.Font.vertical"><tt class="xref py py-attr docutils literal"><span class="pre">Font.vertical</span></tt></a>.</p> -<p>The optional ucs4 argument, an integer, sets the default text translation -mode: 0 (False) recognize UTF-16 surrogate pairs, any other value (True), -to treat Unicode text as UCS-4, with no surrogate pairs. See -<a class="reference internal" href="#pygame.freetype.Font.ucs4" title="pygame.freetype.Font.ucs4"><tt class="xref py py-attr docutils literal"><span class="pre">Font.ucs4</span></tt></a>.</p> -<p>The optional resolution argument sets the pixel size, in dots per inch, -for use in scaling glyphs for this Font instance. If 0 then the default -module value, set by <tt class="xref py py-meth docutils literal"><span class="pre">freetype.init()</span></tt>, is used. The Font object’s -resolution can only be changed by reinitializing the Font instance.</p> -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.name"> -<tt class="descname">name</tt><a class="headerlink" href="#pygame.freetype.Font.name" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Proper font name.</span></div> -<div class="line"><span class="signature">name -> string</span></div> -</div> -<p>Read only. Returns the real (long) name of the font, as -recorded in the font file.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.path"> -<tt class="descname">path</tt><a class="headerlink" href="#pygame.freetype.Font.path" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Font file path</span></div> -<div class="line"><span class="signature">path -> unicode</span></div> -</div> -<p>Read only. Returns the path of the loaded font file</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.get_rect"> -<tt class="descname">get_rect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.get_rect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return the size and offset of rendered text</span></div> -<div class="line"><span class="signature">get_rect(text, style=STYLE_DEFAULT, rotation=0, ptsize=default) -> rect</span></div> -</div> -<p>Gets the final dimensions and origin, in pixels, of ‘text’ using the -current point size, style, rotation and orientation. These are either -taken from the arguments, if given, else from the default values set -for the font object.</p> -<p>Returns a rect containing the width and height of the text’s bounding -box and the position of the text’s origin. The origin can be used -to align separately rendered pieces of text. It gives the baseline -position and bearing at the start of the text.</p> -<p>If text is a char (byte) string, then its encoding is assumed to be -<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.get_metrics"> -<tt class="descname">get_metrics</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.get_metrics" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return the glyph metrics for the given text</span></div> -<div class="line"><span class="signature">get_metrics(text, ptsize=default) -> [(...), ...]</span></div> -</div> -<p>Returns the glyph metrics for each character in ‘text’.</p> -<p>The glyph metrics are returned inside a list; each character will be -represented as a tuple inside the list with the following values:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="p">(</span><span class="n">min_x</span><span class="p">,</span> <span class="n">max_x</span><span class="p">,</span> <span class="n">min_y</span><span class="p">,</span> <span class="n">max_y</span><span class="p">,</span> <span class="n">horizontal_advance_x</span><span class="p">,</span> <span class="n">horizontal_advance_y</span><span class="p">)</span> -</pre></div> -</div> -<p>The bounding box min_x, max_y, min_y, and max_y values are returned as -grid-fitted pixel coordinates of type int. The advance values are -float values.</p> -<p>The calculations are done using the font’s default size in points. -Optionally you may specify another point size to use.</p> -<p>The metrics are adjusted for the current rotation, strong, and oblique -settings.</p> -<p>If text is a char (byte) string, then its encoding is assumed to be -<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.height"> -<tt class="descname">height</tt><a class="headerlink" href="#pygame.freetype.Font.height" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The unscaled height of the font in font units</span></div> -<div class="line"><span class="signature">height -> int</span></div> -</div> -<p>Read only. Gets the height of the font. This is the average value of all -glyphs in the font.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.ascender"> -<tt class="descname">ascender</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.ascender" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The unscaled ascent of the font in font units</span></div> -<div class="line"><span class="signature">ascender -> int</span></div> -</div> -<p>Read only. Return the number of units from the font’s baseline to -the top of the bounding box.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.descender"> -<tt class="descname">descender</tt><a class="headerlink" href="#pygame.freetype.Font.descender" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The unscaled descent of the font in font units</span></div> -<div class="line"><span class="signature">descender -> int</span></div> -</div> -<p>Read only. Return the height in font units for the font descent. -The descent is the number of units from the font’s baseline to the -bottom of the bounding box.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.get_sized_ascender"> -<tt class="descname">get_sized_ascender</tt><a class="headerlink" href="#pygame.freetype.Font.get_sized_ascender" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The scaled ascent of the font in pixels</span></div> -<div class="line"><span class="signature">get_sized_ascender() -> int</span></div> -</div> -<p>Return the number of units from the font’s baseline to the top of the -bounding box. It is not adjusted for strong or rotation.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.get_sized_descender"> -<tt class="descname">get_sized_descender</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.get_sized_descender" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The scaled descent of the font in pixels</span></div> -<div class="line"><span class="signature">get_sized_descender() -> int</span></div> -</div> -<p>Return the number of pixels from the font’s baseline to the top of the -bounding box. It is not adjusted for strong or rotation.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.get_sized_height"> -<tt class="descname">get_sized_height</tt><a class="headerlink" href="#pygame.freetype.Font.get_sized_height" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The scaled height of the font in pixels</span></div> -<div class="line"><span class="signature">get_sized_height() -> int</span></div> -</div> -<p>Read only. Gets the height of the font. This is the average value of all -glyphs in the font. It is not adjusted for strong or rotation.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.get_sized_glyph_height"> -<tt class="descname">get_sized_glyph_height</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.get_sized_glyph_height" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The scaled bounding box height of the font in pixels</span></div> -<div class="line"><span class="signature">get_sized_glyph_height() -> int</span></div> -</div> -<p>Return the glyph bounding box height of the font in pixels. -This is the average value of all glyphs in the font. -It is not adjusted for strong or rotation.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.render"> -<tt class="descname">render</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.render" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return rendered text as a surface</span></div> -<div class="line"><span class="signature">render(text, fgcolor, bgcolor=None, style=STYLE_DEFAULT, rotation=0, ptsize=default) -> (Surface, Rect)</span></div> -</div> -<p>Returns a new <a class="tooltip reference internal" href="surface.html#pygame.Surface" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.Surface</span></tt><span class="tooltip-content">pygame object for representing images</span></a>, with the text rendered to it -in the color given by ‘fgcolor’. If <tt class="docutils literal"><span class="pre">bgcolor</span></tt> is given, the surface -will be filled with this color. If no background color is given, -the surface is filled with zero alpha opacity. Normally the returned -surface has a 32 bit pixel size. However, if <tt class="docutils literal"><span class="pre">bgcolor</span></tt> is <tt class="xref docutils literal"><span class="pre">None</span></tt> -and anti-aliasing is disabled a two color 8 bit surface with colorkey -set for the background color is returned.</p> -<p>The return value is a tuple: the new surface and the bounding -rectangle giving the size and origin of the rendered text.</p> -<p>If an empty string is passed for text then the returned Rect is zero -width and the height of the font. If dest is None the returned surface is -the same dimensions as the boundary rect. The rect will test False.</p> -<p>The rendering is done using the font’s default size in points and its -default style, without any rotation, and taking into account fonts which -are set to be drawn vertically via the <a class="reference internal" href="#pygame.freetype.Font.vertical" title="pygame.freetype.Font.vertical"><tt class="xref py py-meth docutils literal"><span class="pre">Font.vertical()</span></tt></a> attribute. -Optionally you may specify another point size to use via the ‘ptsize’ -argument, a text rotation via the ‘rotation’ argument, or a new text -style via the ‘style’ argument.</p> -<p>If text is a char (byte) string, then its encoding is assumed to be -<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.render_to"> -<tt class="descname">render_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.render_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Render text onto an existing surface</span></div> -<div class="line"><span class="signature">render(surf, dest, text, fgcolor, bgcolor=None, style=STYLE_DEFAULT, rotation=0, ptsize=default) -> Rect</span></div> -</div> -<p>Renders the string ‘text’ to a <a class="tooltip reference internal" href="surface.html#pygame.Surface" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.Surface</span></tt><span class="tooltip-content">pygame object for representing images</span></a> ‘surf’, -using the color ‘fgcolor’.</p> -<p>Argument ‘dest’ is an (x, y) surface coordinate pair. If either x -or y is not an integer it is converted to one if possible. -Any sequence, including Rect, for which the first two elements are -positions x and y is accepted.</p> -<p>If a background color is given, the surface is first filled with that -color. The text is blitted next. Both the background fill and text -rendering involve full alpha blits. That is, the alpha values of -both the foreground and background colors, as well as those of the -destination surface if it has per-pixel alpha.</p> -<p>The return value is a rectangle giving the size and position of the -rendered text within the surface.</p> -<p>If an empty string is passed for text then the returned Rect is zero -width and the height of the font. The rect will test False.</p> -<p>By default, the point size and style set for the font are used -if not passed as arguments. The text is unrotated unless a non-zero -rotation value is given.</p> -<p>If text is a char (byte) string, then its encoding is assumed to be -<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.render_raw"> -<tt class="descname">render_raw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.render_raw" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return rendered text as a string of bytes</span></div> -<div class="line"><span class="signature">render_raw(text, style=STYLE_DEFAULT, rotation=0, ptsize=default, invert=False) -> (bytes, (int, int))</span></div> -</div> -<p>Like <tt class="docutils literal"><span class="pre">Font.render()</span></tt> but the tuple returned is an 8 bit -monochrome string of bytes and its size. The foreground color is 255, the -background 0, useful as an alpha mask for a foreground pattern.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.freetype.Font.render_raw_to"> -<tt class="descname">render_raw_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Font.render_raw_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Render text into an array of ints</span></div> -<div class="line"><span class="signature">render_raw_to(array, text, dest=None, style=STYLE_DEFAULT, rotation=0, ptsize=default, invert=False) -> (int, int)</span></div> -</div> -<p>Render to an array object exposing an array struct interface. The array -must be two dimensional with integer items. The default dest value, None, -is equivalent to (0, 0).</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.style"> -<tt class="descname">style</tt><a class="headerlink" href="#pygame.freetype.Font.style" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The font’s style flags</span></div> -<div class="line"><span class="signature">style <-> int</span></div> -</div> -<p>Gets or sets the default style of the Font. This default style will be -used for all text rendering and size calculations unless overridden -specifically in the `render()` or `get_size()` calls. The style value -may be a bit-wise <tt class="docutils literal"><span class="pre">OR</span></tt> of one or more of the following constants:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">STYLE_NONE</span> -<span class="n">STYLE_UNDERLINE</span> -<span class="n">STYLE_OBLIQUE</span> -<span class="n">STYLE_STRONG</span> -<span class="n">STYLE_WIDE</span> -</pre></div> -</div> -<p>These constants may be found on the FreeType constants module. -Optionally, the default style can be modified or obtained accessing the -individual style attributes (underline, oblique, strong).</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.underline"> -<tt class="descname">underline</tt><a class="headerlink" href="#pygame.freetype.Font.underline" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The state of the font’s underline style flag</span></div> -<div class="line"><span class="signature">underline <-> bool</span></div> -</div> -<p>Gets or sets whether the font will be underlined when drawing text. This -default style value will be used for all text rendering and size -calculations unless overridden specifically in the `render()` or -`get_size()` calls, via the ‘style’ parameter.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.strong"> -<tt class="descname">strong</tt><a class="headerlink" href="#pygame.freetype.Font.strong" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The state of the font’s strong style flag</span></div> -<div class="line"><span class="signature">strong <-> bool</span></div> -</div> -<p>Gets or sets whether the font will be bold when drawing text. This -default style value will be used for all text rendering and size -calculations unless overridden specifically in the `render()` or -`get_size()` calls, via the ‘style’ parameter.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.oblique"> -<tt class="descname">oblique</tt><a class="headerlink" href="#pygame.freetype.Font.oblique" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The state of the font’s oblique style flag</span></div> -<div class="line"><span class="signature">oblique <-> bool</span></div> -</div> -<p>Gets or sets whether the font will be rendered as oblique. This -default style value will be used for all text rendering and size -calculations unless overridden specifically in the `render()` or -`get_size()` calls, via the ‘style’ parameter.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.wide"> -<tt class="descname">wide</tt><a class="headerlink" href="#pygame.freetype.Font.wide" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The state of the font’s wide style flag</span></div> -<div class="line"><span class="signature">wide <-> bool</span></div> -</div> -<p>Gets or sets whether the font will be stretched horizontally -when drawing text. It produces a result similar to font.Font’s -bold. This style is only available for unrotated text.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.strength"> -<tt class="descname">strength</tt><a class="headerlink" href="#pygame.freetype.Font.strength" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The strength associated with the strong or wide font styles</span></div> -<div class="line"><span class="signature">strength <-> float</span></div> -</div> -<p>The amount by which a font glyph’s size is enlarged for the -strong or wide transformations, as a fraction of the untransformed -size. For the wide style only the horizontal dimension is -increased. For strong text both the horizontal and vertical -dimensions are enlarged. A wide style of strength 1/12 is -equivalent to the font.Font bold style. The default is 1/36.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.underline_adjustment"> -<tt class="descname">underline_adjustment</tt><a class="headerlink" href="#pygame.freetype.Font.underline_adjustment" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Adjustment factor for the underline position</span></div> -<div class="line"><span class="signature">underline_adjustment <-> float</span></div> -</div> -<p>Gets or sets a factor which, when positive, is multiplied with the -font’s underline offset to adjust the underline position. A negative -value turns an underline into a strike-through or overline. It is -multiplied with the ascender. Accepted values are between -2.0 and 2.0 -inclusive. A value of 0.5 closely matches Tango underlining. A value of -1.0 mimics SDL_ttf.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.fixed_width"> -<tt class="descname">fixed_width</tt><a class="headerlink" href="#pygame.freetype.Font.fixed_width" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets whether the font is fixed-width</span></div> -<div class="line"><span class="signature">fixed_width -> bool</span></div> -</div> -<p>Read only. Returns whether this Font is a fixed-width (bitmap) font.</p> -<p>Note that scalable fonts whose glyphs are all the same width (i.e. -monospace <tt class="docutils literal"><span class="pre">TTF</span></tt> fonts used for programming) are not considered fixed -width.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.antialiased"> -<tt class="descname">antialiased</tt><a class="headerlink" href="#pygame.freetype.Font.antialiased" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Font anti-aliasing mode</span></div> -<div class="line"><span class="signature">antialiased <-> bool</span></div> -</div> -<p>Gets or sets the font’s anti-aliasing mode. This defaults to <tt class="xref docutils literal"><span class="pre">True</span></tt> on -all fonts, which are rendered with full 8 bit blending.</p> -<p>Setting this to <tt class="xref docutils literal"><span class="pre">False</span></tt> will enable monochrome rendering. This should -provide a small speed gain and reduce cache memory size.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.kerning"> -<tt class="descname">kerning</tt><a class="headerlink" href="#pygame.freetype.Font.kerning" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Character kerning mode</span></div> -<div class="line"><span class="signature">kerning -> bool</span></div> -</div> -<p>Gets or sets the font’s kerning mode. This defaults to False on all -fonts, which will be rendered by default without kerning.</p> -<p>Setting this to true will change all rendering methods to do kerning -between character pairs for surface size calculation and all -render operations.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.vertical"> -<tt class="descname">vertical</tt><a class="headerlink" href="#pygame.freetype.Font.vertical" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Font vertical mode</span></div> -<div class="line"><span class="signature">vertical -> bool</span></div> -</div> -<p>Gets or sets whether the font is a vertical font such as fonts in fonts -representing Kanji glyphs or other styles of vertical writing.</p> -<p>Changing this attribute will cause the font to be rendering vertically, -and affects all other methods which manage glyphs or text layouts to use -vertical metrics accordingly.</p> -<p>Note that the FreeType library doesn’t automatically detect whether a -font contains glyphs which are always supposed to be drawn vertically, so -this attribute must be set manually by the user.</p> -<p>Also note that several font formats (especially bitmap based ones) don’t -contain the necessary metrics to draw glyphs vertically, so drawing in -those cases will give unspecified results.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.origin"> -<tt class="descname">origin</tt><a class="headerlink" href="#pygame.freetype.Font.origin" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Font render to text origin mode</span></div> -<div class="line"><span class="signature">vertical -> bool</span></div> -</div> -<p>If set True, then when rendering to an existing surface, the position -is taken to be that of the text origin. Otherwise the render position is -the top-left corner of the text bounding box.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.pad"> -<tt class="descname">pad</tt><a class="headerlink" href="#pygame.freetype.Font.pad" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">padded boundary mode</span></div> -<div class="line"><span class="signature">pad -> bool</span></div> -</div> -<p>If set True, then the text boundary rectangle will be inflated to match -that of font.Font. Otherwise, the boundary rectangle is just large -enough for the text.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.ucs4"> -<tt class="descname">ucs4</tt><a class="headerlink" href="#pygame.freetype.Font.ucs4" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Enable UCS-4 mode</span></div> -<div class="line"><span class="signature">ucs4 <-> bool</span></div> -</div> -<p>Gets or sets the decoding of Unicode text. By default, the -freetype module performs UTF-16 surrogate pair decoding on Unicode text. -This allows 32-bit escape sequences (‘Uxxxxxxxx’) between 0x10000 and -0x10FFFF to represent their corresponding UTF-32 code points on Python -interpreters built with a UCS-2 unicode type (on Windows, for instance). -It also means character values within the UTF-16 surrogate area (0xD800 -to 0xDFFF) are considered part of a surrogate pair. A malformed surrogate -pair will raise an UnicodeEncodeError. Setting ucs4 True turns surrogate -pair decoding off, letting interpreters with a UCS-4 unicode type access -the full UCS-4 character range.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.freetype.Font.resolution"> -<tt class="descname">resolution</tt><a class="headerlink" href="#pygame.freetype.Font.resolution" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Pixel resolution in dots per inch</span></div> -<div class="line"><span class="signature">resolution -> int</span></div> -</div> -<p>Gets the pixel size used in scaling font glyphs for this Font instance.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="gfxdraw.html" title="pygame.gfxdraw" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="font.html" title="pygame.font" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/gfxdraw.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,492 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.gfxdraw — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.image" href="image.html" /> - <link rel="prev" title="pygame.freetype" href="freetype.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.gfxdraw"> -<span id="pygame-gfxdraw"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.gfxdraw</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for drawing shapes</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="45%" /> -<col width="1%" /> -<col width="53%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.pixel">pygame.gfxdraw.pixel</a></td> -<td>—</td> -<td>place a pixel</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.hline">pygame.gfxdraw.hline</a></td> -<td>—</td> -<td>draw a horizontal line</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.vline">pygame.gfxdraw.vline</a></td> -<td>—</td> -<td>draw a vertical line</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.rectangle">pygame.gfxdraw.rectangle</a></td> -<td>—</td> -<td>draw a rectangle</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.box">pygame.gfxdraw.box</a></td> -<td>—</td> -<td>draw a box</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.line">pygame.gfxdraw.line</a></td> -<td>—</td> -<td>draw a line</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.circle">pygame.gfxdraw.circle</a></td> -<td>—</td> -<td>draw a circle</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.arc">pygame.gfxdraw.arc</a></td> -<td>—</td> -<td>draw an arc</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.aacircle">pygame.gfxdraw.aacircle</a></td> -<td>—</td> -<td>draw an anti-aliased circle</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.filled_circle">pygame.gfxdraw.filled_circle</a></td> -<td>—</td> -<td>draw a filled circle</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.ellipse">pygame.gfxdraw.ellipse</a></td> -<td>—</td> -<td>draw an ellipse</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.aaellipse">pygame.gfxdraw.aaellipse</a></td> -<td>—</td> -<td>draw an anti-aliased ellipse</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.filled_ellipse">pygame.gfxdraw.filled_ellipse</a></td> -<td>—</td> -<td>draw a filled ellipse</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.pie">pygame.gfxdraw.pie</a></td> -<td>—</td> -<td>draw a pie</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.trigon">pygame.gfxdraw.trigon</a></td> -<td>—</td> -<td>draw a triangle</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.aatrigon">pygame.gfxdraw.aatrigon</a></td> -<td>—</td> -<td>draw an anti-aliased triangle</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.filled_trigon">pygame.gfxdraw.filled_trigon</a></td> -<td>—</td> -<td>draw a filled trigon</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.polygon">pygame.gfxdraw.polygon</a></td> -<td>—</td> -<td>draw a polygon</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.aapolygon">pygame.gfxdraw.aapolygon</a></td> -<td>—</td> -<td>draw an anti-aliased polygon</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.filled_polygon">pygame.gfxdraw.filled_polygon</a></td> -<td>—</td> -<td>draw a filled polygon</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.textured_polygon">pygame.gfxdraw.textured_polygon</a></td> -<td>—</td> -<td>draw a textured polygon</td> -</tr> -<tr><td><a class="toc reference external" href="gfxdraw.html#pygame.gfxdraw.bezier">pygame.gfxdraw.bezier</a></td> -<td>—</td> -<td>draw a bezier curve</td> -</tr> -</tbody> -</table> -<p>EXPERIMENTAL!: meaning this api may change, or dissapear in later pygame -releases. If you use this, your code will break with the next pygame release.</p> -<p>Draw several shapes to a surface.</p> -<p>Most of the functions accept a color argument that is an <tt class="docutils literal"><span class="pre">RGB</span></tt> triplet. These -can also accept an <tt class="docutils literal"><span class="pre">RGBA</span></tt> quadruplet. The color argument can also be an -integer pixel value that is already mapped to the Surface’s pixel format.</p> -<p>For all functions the arguments are strictly positional. Only integers are -accepted for coordinates and radii.</p> -<p>For functions like rectangle that accept a rect argument any (x, y, w, h) -sequence is accepted, though <a class="tooltip reference internal" href="rect.html#pygame.Rect" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.Rect</span></tt><span class="tooltip-content">pygame object for storing rectangular coordinates</span></a> instances are prefered. Note -that for a <a class="tooltip reference internal" href="rect.html#pygame.Rect" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.Rect</span></tt><span class="tooltip-content">pygame object for storing rectangular coordinates</span></a> the drawing will not include -<tt class="docutils literal"><span class="pre">Rect.bottomright</span></tt>. The right and bottom attributes of a Rect lie one pixel -outside of the Rect’s boarder.</p> -<p>To draw an anti aliased and filled shape, first use the aa* version of -the function, and then use the filled version. For example</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">col</span> <span class="o">=</span> <span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> -<span class="n">surf</span><span class="o">.</span><span class="n">fill</span><span class="p">((</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">))</span> -<span class="n">pygame</span><span class="o">.</span><span class="n">gfxdraw</span><span class="o">.</span><span class="n">aacircle</span><span class="p">(</span><span class="n">surf</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="n">col</span><span class="p">)</span> -<span class="n">pygame</span><span class="o">.</span><span class="n">gfxdraw</span><span class="o">.</span><span class="n">filled_circle</span><span class="p">(</span><span class="n">surf</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="n">col</span><span class="p">)</span> -</pre></div> -</div> -<p>Note that pygame does not automatically import pygame.gfxdraw, so you need to -import pygame.gfxdraw before using it.</p> -<p>Threading note: each of the functions releases the GIL during the C part of the call.</p> -<p>The pygame.gfxdraw module differs from the draw module in the API it uses, and -also the different functions available to draw. It also wraps the primitives -from the library called SDL_gfx, rather than using modified versions.</p> -<p>New in pygame 1.9.0.</p> -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.pixel"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">pixel</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.pixel" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">place a pixel</span></div> -<div class="line"><span class="signature">pixel(surface, x, y, color) -> None</span></div> -</div> -<p>Draws a single pixel onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.hline"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">hline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.hline" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a horizontal line</span></div> -<div class="line"><span class="signature">hline(surface, x1, x2, y, color) -> None</span></div> -</div> -<p>Draws a straight horizontal line on a Surface from x1 to x2 for -the given y coordinate.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.vline"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">vline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.vline" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a vertical line</span></div> -<div class="line"><span class="signature">vline(surface, x, y1, y2, color) -> None</span></div> -</div> -<p>Draws a straight vertical line on a Surface from y1 to y2 on -the given x coordinate.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.rectangle"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">rectangle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.rectangle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a rectangle</span></div> -<div class="line"><span class="signature">rectangle(surface, rect, color) -> None</span></div> -</div> -<p>Draws the rectangle edges onto the surface. The given Rect is the area of the -rectangle.</p> -<p>Keep in mind the <tt class="docutils literal"><span class="pre">Surface.fill()</span></tt> method works just as well for drawing -filled rectangles. In fact the <tt class="docutils literal"><span class="pre">Surface.fill()</span></tt> can be hardware -accelerated on some platforms with both software and hardware display modes.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.box"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">box</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.box" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a box</span></div> -<div class="line"><span class="signature">box(surface, rect, color) -> None</span></div> -</div> -<p>Draws a box (a rect) onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.line"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">line</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.line" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a line</span></div> -<div class="line"><span class="signature">line(surface, x1, y1, x2, y2, color) -> None</span></div> -</div> -<p>Draws a straight line on a Surface. There are no endcaps.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.circle"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">circle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.circle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a circle</span></div> -<div class="line"><span class="signature">circle(surface, x, y, r, color) -> None</span></div> -</div> -<p>Draws the edges of a circular shape on the Surface. The pos argument is -the center of the circle, and radius is the size. The circle is not -filled with color.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.arc"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">arc</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.arc" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw an arc</span></div> -<div class="line"><span class="signature">arc(surface, x, y, r, start, end, color) -> None</span></div> -</div> -<p>Draws an arc onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.aacircle"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">aacircle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.aacircle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw an anti-aliased circle</span></div> -<div class="line"><span class="signature">aacircle(surface, x, y, r, color) -> None</span></div> -</div> -<p>Draws the edges of an anti aliased circle onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.filled_circle"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">filled_circle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.filled_circle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a filled circle</span></div> -<div class="line"><span class="signature">filled_circle(surface, x, y, r, color) -> None</span></div> -</div> -<p>Draws a filled circle onto a surface. So the inside of the circle will -be filled with the given color.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.ellipse"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">ellipse</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.ellipse" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw an ellipse</span></div> -<div class="line"><span class="signature">ellipse(surface, x, y, rx, ry, color) -> None</span></div> -</div> -<p>Draws the edges of an ellipse onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.aaellipse"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">aaellipse</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.aaellipse" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw an anti-aliased ellipse</span></div> -<div class="line"><span class="signature">aaellipse(surface, x, y, rx, ry, color) -> None</span></div> -</div> -<p>Draws anti aliased edges of an ellipse onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.filled_ellipse"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">filled_ellipse</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.filled_ellipse" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a filled ellipse</span></div> -<div class="line"><span class="signature">filled_ellipse(surface, x, y, rx, ry, color) -> None</span></div> -</div> -<p>Draws a filled ellipse onto a surface. So the inside of the elipse will -be filled with the given color.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.pie"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">pie</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.pie" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a pie</span></div> -<div class="line"><span class="signature">pie(surface, x, y, r, start, end, color) -> None</span></div> -</div> -<p>Draws a pie onto the surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.trigon"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">trigon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.trigon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a triangle</span></div> -<div class="line"><span class="signature">trigon(surface, x1, y1, x2, y2, x3, y3, color) -> None</span></div> -</div> -<p>Draws the edges of a trigon onto a surface. A trigon is a triangle.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.aatrigon"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">aatrigon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.aatrigon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw an anti-aliased triangle</span></div> -<div class="line"><span class="signature">aatrigon(surface, x1, y1, x2, y2, x3, y3, color) -> None</span></div> -</div> -<p>Draws the anti aliased edges of a trigon onto a surface. A trigon is a triangle.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.filled_trigon"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">filled_trigon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.filled_trigon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a filled trigon</span></div> -<div class="line"><span class="signature">filled_trigon(surface, x1, y1, x2, y2, x3, y3, color) -> None</span></div> -</div> -<p>Draws a filled trigon onto a surface. So the inside of the trigon will -be filled with the given color.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.polygon"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">polygon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.polygon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a polygon</span></div> -<div class="line"><span class="signature">polygon(surface, points, color) -> None</span></div> -</div> -<p>Draws the edges of a polygon onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.aapolygon"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">aapolygon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.aapolygon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw an anti-aliased polygon</span></div> -<div class="line"><span class="signature">aapolygon(surface, points, color) -> None</span></div> -</div> -<p>Draws the anti aliased edges of a polygon onto a surface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.filled_polygon"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">filled_polygon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.filled_polygon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a filled polygon</span></div> -<div class="line"><span class="signature">filled_polygon(surface, points, color) -> None</span></div> -</div> -<p>Draws a filled polygon onto a surface. So the inside of the polygon will -be filled with the given color.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.textured_polygon"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">textured_polygon</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.textured_polygon" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a textured polygon</span></div> -<div class="line"><span class="signature">textured_polygon(surface, points, texture, tx, ty) -> None</span></div> -</div> -<p>Draws a textured polygon onto a surface.</p> -<p>A per-pixel alpha texture blit to a per-pixel alpha surface will differ from -a <tt class="docutils literal"><span class="pre">Surface.blit()</span></tt> blit. Also, a per-pixel alpha texture cannot be used -with an 8-bit per pixel destination.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.gfxdraw.bezier"> -<tt class="descclassname">pygame.gfxdraw.</tt><tt class="descname">bezier</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.gfxdraw.bezier" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a bezier curve</span></div> -<div class="line"><span class="signature">bezier(surface, points, steps, color) -> None</span></div> -</div> -<p>Draws a bezier onto a surface.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="image.html" title="pygame.image" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="freetype.html" title="pygame.freetype" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/image.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,313 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.image — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.joystick" href="joystick.html" /> - <link rel="prev" title="pygame.gfxdraw" href="gfxdraw.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.image"> -<span id="pygame-image"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.image</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for image transfer</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="28%" /> -<col width="1%" /> -<col width="71%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="image.html#pygame.image.load">pygame.image.load</a></td> -<td>—</td> -<td>load new image from a file</td> -</tr> -<tr><td><a class="toc reference external" href="image.html#pygame.image.save">pygame.image.save</a></td> -<td>—</td> -<td>save an image to disk</td> -</tr> -<tr><td><a class="toc reference external" href="image.html#pygame.image.get_extended">pygame.image.get_extended</a></td> -<td>—</td> -<td>test if extended image formats can be loaded</td> -</tr> -<tr><td><a class="toc reference external" href="image.html#pygame.image.tostring">pygame.image.tostring</a></td> -<td>—</td> -<td>transfer image to string buffer</td> -</tr> -<tr><td><a class="toc reference external" href="image.html#pygame.image.fromstring">pygame.image.fromstring</a></td> -<td>—</td> -<td>create new Surface from a string buffer</td> -</tr> -<tr><td><a class="toc reference external" href="image.html#pygame.image.frombuffer">pygame.image.frombuffer</a></td> -<td>—</td> -<td>create a new Surface that shares data inside a string buffer</td> -</tr> -</tbody> -</table> -<p>The image module contains functions for loading and saving pictures, as well as -transferring Surfaces to formats usable by other packages. .</p> -<p>Note that there is no Image class; an image is loaded as a Surface object. The -Surface class allows manipulation (drawing lines, setting pixels, capturing -regions, etc.).</p> -<p>The image module is a required dependency of Pygame, but it only optionally -supports any extended file formats. By default it can only load uncompressed -<tt class="docutils literal"><span class="pre">BMP</span></tt> images. When built with full image support, the <tt class="docutils literal"><span class="pre">pygame.image.load()</span></tt> -function can support the following formats.</p> -<blockquote> -<ul class="simple"> -<li><tt class="docutils literal"><span class="pre">JPG</span></tt></li> -<li><tt class="docutils literal"><span class="pre">PNG</span></tt></li> -<li><tt class="docutils literal"><span class="pre">GIF</span></tt> (non animated)</li> -<li><tt class="docutils literal"><span class="pre">BMP</span></tt></li> -<li><tt class="docutils literal"><span class="pre">PCX</span></tt></li> -<li><tt class="docutils literal"><span class="pre">TGA</span></tt> (uncompressed)</li> -<li><tt class="docutils literal"><span class="pre">TIF</span></tt></li> -<li><tt class="docutils literal"><span class="pre">LBM</span></tt> (and <tt class="docutils literal"><span class="pre">PBM</span></tt>)</li> -<li><tt class="docutils literal"><span class="pre">PBM</span></tt> (and <tt class="docutils literal"><span class="pre">PGM</span></tt>, <tt class="docutils literal"><span class="pre">PPM</span></tt>)</li> -<li><tt class="docutils literal"><span class="pre">XPM</span></tt></li> -</ul> -</blockquote> -<p>Saving images only supports a limited set of formats. You can save to the -following formats.</p> -<blockquote> -<ul class="simple"> -<li><tt class="docutils literal"><span class="pre">BMP</span></tt></li> -<li><tt class="docutils literal"><span class="pre">TGA</span></tt></li> -<li><tt class="docutils literal"><span class="pre">PNG</span></tt></li> -<li><tt class="docutils literal"><span class="pre">JPEG</span></tt></li> -</ul> -</blockquote> -<p><tt class="docutils literal"><span class="pre">PNG</span></tt>, <tt class="docutils literal"><span class="pre">JPEG</span></tt> saving new in pygame 1.8.</p> -<dl class="definition function"> -<dt class="title" id="pygame.image.load"> -<tt class="descclassname">pygame.image.</tt><tt class="descname">load</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.load" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">load new image from a file</span></div> -<div class="line"><span class="signature">load(filename) -> Surface</span></div> -<div class="line"><span class="signature">load(fileobj, namehint=””) -> Surface</span></div> -</div> -<p>Load an image from a file source. You can pass either a filename or a Python -file-like object.</p> -<p>Pygame will automatically determine the image type (e.g., <tt class="docutils literal"><span class="pre">GIF</span></tt> or bitmap) -and create a new Surface object from the data. In some cases it will need to -know the file extension (e.g., <tt class="docutils literal"><span class="pre">GIF</span></tt> images should end in ”.gif”). If you -pass a raw file-like object, you may also want to pass the original filename -as the namehint argument.</p> -<p>The returned Surface will contain the same color format, colorkey and alpha -transparency as the file it came from. You will often want to call -<tt class="docutils literal"><span class="pre">Surface.convert()</span></tt> with no arguments, to create a copy that will draw -more quickly on the screen.</p> -<p>For alpha transparency, like in .png images use the <tt class="docutils literal"><span class="pre">convert_alpha()</span></tt> -method after loading so that the image has per pixel transparency.</p> -<p>Pygame may not always be built to support all image formats. At minimum it -will support uncompressed <tt class="docutils literal"><span class="pre">BMP</span></tt>. If <tt class="docutils literal"><span class="pre">pygame.image.get_extended()</span></tt> -returns ‘True’, you should be able to load most images (including png, jpg -and gif).</p> -<p>You should use <tt class="docutils literal"><span class="pre">os.path.join()</span></tt> for compatibility.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">eg</span><span class="o">.</span> <span class="n">asurf</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">image</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s">'data'</span><span class="p">,</span> <span class="s">'bla.png'</span><span class="p">))</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.image.save"> -<tt class="descclassname">pygame.image.</tt><tt class="descname">save</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.save" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">save an image to disk</span></div> -<div class="line"><span class="signature">save(Surface, filename) -> None</span></div> -</div> -<p>This will save your Surface as either a <tt class="docutils literal"><span class="pre">BMP</span></tt>, <tt class="docutils literal"><span class="pre">TGA</span></tt>, <tt class="docutils literal"><span class="pre">PNG</span></tt>, or -<tt class="docutils literal"><span class="pre">JPEG</span></tt> image. If the filename extension is unrecognized it will default to -<tt class="docutils literal"><span class="pre">TGA</span></tt>. Both <tt class="docutils literal"><span class="pre">TGA</span></tt>, and <tt class="docutils literal"><span class="pre">BMP</span></tt> file formats create uncompressed files.</p> -<p><tt class="docutils literal"><span class="pre">PNG</span></tt>, <tt class="docutils literal"><span class="pre">JPEG</span></tt> saving new in pygame 1.8.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.image.get_extended"> -<tt class="descclassname">pygame.image.</tt><tt class="descname">get_extended</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.get_extended" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if extended image formats can be loaded</span></div> -<div class="line"><span class="signature">get_extended() -> bool</span></div> -</div> -<p>If pygame is built with extended image formats this function will return -True. It is still not possible to determine which formats will be available, -but generally you will be able to load them all.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.image.tostring"> -<tt class="descclassname">pygame.image.</tt><tt class="descname">tostring</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.tostring" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">transfer image to string buffer</span></div> -<div class="line"><span class="signature">tostring(Surface, format, flipped=False) -> string</span></div> -</div> -<p>Creates a string that can be transferred with the ‘fromstring’ method in -other Python imaging packages. Some Python image packages prefer their -images in bottom-to-top format (PyOpenGL for example). If you pass True for -the flipped argument, the string buffer will be vertically flipped.</p> -<p>The format argument is a string of one of the following values. Note that -only 8bit Surfaces can use the “P” format. The other formats will work for -any Surface. Also note that other Python image packages support more formats -than Pygame.</p> -<blockquote> -<ul class="simple"> -<li><tt class="docutils literal"><span class="pre">P</span></tt>, 8bit palettized Surfaces</li> -<li><tt class="docutils literal"><span class="pre">RGB</span></tt>, 24bit image</li> -<li><tt class="docutils literal"><span class="pre">RGBX</span></tt>, 32bit image with unused space</li> -<li><tt class="docutils literal"><span class="pre">RGBA</span></tt>, 32bit image with an alpha channel</li> -<li><tt class="docutils literal"><span class="pre">ARGB</span></tt>, 32bit image with alpha channel first</li> -<li><tt class="docutils literal"><span class="pre">RGBA_PREMULT</span></tt>, 32bit image with colors scaled by alpha channel</li> -<li><tt class="docutils literal"><span class="pre">ARGB_PREMULT</span></tt>, 32bit image with colors scaled by alpha channel, alpha channel first</li> -</ul> -</blockquote> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.image.fromstring"> -<tt class="descclassname">pygame.image.</tt><tt class="descname">fromstring</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.fromstring" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create new Surface from a string buffer</span></div> -<div class="line"><span class="signature">fromstring(string, size, format, flipped=False) -> Surface</span></div> -</div> -<p>This function takes arguments similar to <tt class="docutils literal"><span class="pre">pygame.image.tostring()</span></tt>. The -size argument is a pair of numbers representing the width and height. Once -the new Surface is created you can destroy the string buffer.</p> -<p>The size and format image must compute the exact same size as the passed -string buffer. Otherwise an exception will be raised.</p> -<p>See the <tt class="docutils literal"><span class="pre">pygame.image.frombuffer()</span></tt> method for a potentially faster way to -transfer images into Pygame.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.image.frombuffer"> -<tt class="descclassname">pygame.image.</tt><tt class="descname">frombuffer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.image.frombuffer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create a new Surface that shares data inside a string buffer</span></div> -<div class="line"><span class="signature">frombuffer(string, size, format) -> Surface</span></div> -</div> -<p>Create a new Surface that shares pixel data directly from the string buffer. -This method takes the same arguments as <tt class="docutils literal"><span class="pre">pygame.image.fromstring()</span></tt>, but -is unable to vertically flip the source data.</p> -<p>This will run much faster than <a class="tooltip reference internal" href="#pygame.image.fromstring" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.image.fromstring()</span></tt><span class="tooltip-content">create new Surface from a string buffer</span></a>, since no -pixel data must be allocated and copied.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="joystick.html" title="pygame.joystick" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="gfxdraw.html" title="pygame.gfxdraw" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/joystick.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,481 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.joystick — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.key" href="key.html" /> - <link rel="prev" title="pygame.image" href="image.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.joystick"> -<span id="pygame-joystick"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.joystick</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for interacting with joystick devices</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="34%" /> -<col width="1%" /> -<col width="65%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.init">pygame.joystick.init</a></td> -<td>—</td> -<td>initialize the joystick module</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.quit">pygame.joystick.quit</a></td> -<td>—</td> -<td>uninitialize the joystick module</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.get_init">pygame.joystick.get_init</a></td> -<td>—</td> -<td>true if the joystick module is initialized</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.get_count">pygame.joystick.get_count</a></td> -<td>—</td> -<td>number of joysticks on the system</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick">pygame.joystick.Joystick</a></td> -<td>—</td> -<td>create a new Joystick object</td> -</tr> -</tbody> -</table> -<p>The joystick module manages the joystick devices on a computer (there can be -more than one). Joystick devices include trackballs and video-game-style -gamepads, and the module allows the use of multiple buttons and “hats”.</p> -<p>To get initialise the joystick module and get a list of Joystick instances -use the following code:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pygame</span><span class="o">.</span><span class="n">joystick</span><span class="o">.</span><span class="n">init</span><span class="p">()</span> -<span class="n">joysticks</span> <span class="o">=</span> <span class="p">[</span><span class="n">pygame</span><span class="o">.</span><span class="n">joystick</span><span class="o">.</span><span class="n">Joystick</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">pygame</span><span class="o">.</span><span class="n">joystick</span><span class="o">.</span><span class="n">get_count</span><span class="p">())]</span> -</pre></div> -</div> -<p>The following event types will be generated by the joysticks</p> -<div class="highlight-python"><pre>JOYAXISMOTION JOYBALLMOTION JOYBUTTONDOWN JOYBUTTONUP JOYHATMOTION</pre> -</div> -<p>The event queue needs to be pumped frequently for some of the methods to work. -So call one of pygame.event.get, pygame.event.wait, or pygame.event.pump regularly.</p> -<dl class="definition function"> -<dt class="title" id="pygame.joystick.init"> -<tt class="descclassname">pygame.joystick.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize the joystick module</span></div> -<div class="line"><span class="signature">init() -> None</span></div> -</div> -<p>This function is called automatically by <tt class="docutils literal"><span class="pre">pygame.init()</span></tt>.</p> -<p>It initializes the joystick module. This will scan the system for all -joystick devices. The module must be initialized before any other functions -will work.</p> -<p>It is safe to call this function more than once.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.joystick.quit"> -<tt class="descclassname">pygame.joystick.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize the joystick module</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>Uninitialize the joystick module. After you call this any existing joystick -objects will no longer work.</p> -<p>It is safe to call this function more than once.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.joystick.get_init"> -<tt class="descclassname">pygame.joystick.</tt><tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.get_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the joystick module is initialized</span></div> -<div class="line"><span class="signature">get_init() -> bool</span></div> -</div> -<p>Test if the <tt class="docutils literal"><span class="pre">pygame.joystick.init()</span></tt> function has been called.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.joystick.get_count"> -<tt class="descclassname">pygame.joystick.</tt><tt class="descname">get_count</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.get_count" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">number of joysticks on the system</span></div> -<div class="line"><span class="signature">get_count() -> count</span></div> -</div> -<p>Return the number of joystick devices on the system. The count will be 0 if -there are no joysticks on the system.</p> -<p>When you create Joystick objects using <tt class="docutils literal"><span class="pre">Joystick(id)</span></tt>, you pass an integer -that must be lower than this count.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.joystick.Joystick"> -<em class="property">class </em><tt class="descclassname">pygame.joystick.</tt><tt class="descname">Joystick</tt><a class="headerlink" href="#pygame.joystick.Joystick" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create a new Joystick object</span></div> -<div class="line"><span class="signature">Joystick(id) -> Joystick</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="43%" /> -<col width="1%" /> -<col width="56%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.init">pygame.joystick.Joystick.init</a></td> -<td>—</td> -<td>initialize the Joystick</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.quit">pygame.joystick.Joystick.quit</a></td> -<td>—</td> -<td>uninitialize the Joystick</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_init">pygame.joystick.Joystick.get_init</a></td> -<td>—</td> -<td>check if the Joystick is initialized</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_id">pygame.joystick.Joystick.get_id</a></td> -<td>—</td> -<td>get the Joystick ID</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_name">pygame.joystick.Joystick.get_name</a></td> -<td>—</td> -<td>get the Joystick system name</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_numaxes">pygame.joystick.Joystick.get_numaxes</a></td> -<td>—</td> -<td>get the number of axes on a Joystick</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_axis">pygame.joystick.Joystick.get_axis</a></td> -<td>—</td> -<td>get the current position of an axis</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_numballs">pygame.joystick.Joystick.get_numballs</a></td> -<td>—</td> -<td>get the number of trackballs on a Joystick</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_ball">pygame.joystick.Joystick.get_ball</a></td> -<td>—</td> -<td>get the relative position of a trackball</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_numbuttons">pygame.joystick.Joystick.get_numbuttons</a></td> -<td>—</td> -<td>get the number of buttons on a Joystick</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_button">pygame.joystick.Joystick.get_button</a></td> -<td>—</td> -<td>get the current button state</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_numhats">pygame.joystick.Joystick.get_numhats</a></td> -<td>—</td> -<td>get the number of hat controls on a Joystick</td> -</tr> -<tr><td><a class="toc reference external" href="joystick.html#pygame.joystick.Joystick.get_hat">pygame.joystick.Joystick.get_hat</a></td> -<td>—</td> -<td>get the position of a joystick hat</td> -</tr> -</tbody> -</table> -<p>Create a new joystick to access a physical device. The id argument must be a -value from 0 to pygame.joystick.get_count()-1.</p> -<p>To access most of the Joystick methods, you’ll need to <tt class="docutils literal"><span class="pre">init()</span></tt> the -Joystick. This is separate from making sure the joystick module is -initialized. When multiple Joysticks objects are created for the same -physical joystick device (i.e., they have the same <tt class="docutils literal"><span class="pre">ID</span></tt> number), the state -and values for those Joystick objects will be shared.</p> -<p>The Joystick object allows you to get information about the types of -controls on a joystick device. Once the device is initialized the Pygame -event queue will start receiving events about its input.</p> -<p>You can call the <tt class="docutils literal"><span class="pre">Joystick.get_name()</span></tt> and <tt class="docutils literal"><span class="pre">Joystick.get_id()</span></tt> functions -without initializing the Joystick object.</p> -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.init"> -<tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize the Joystick</span></div> -<div class="line"><span class="signature">init() -> None</span></div> -</div> -<p>The Joystick must be initialized to get most of the information about the -controls. While the Joystick is initialized the Pygame event queue will -receive events from the Joystick input.</p> -<p>It is safe to call this more than once.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.quit"> -<tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize the Joystick</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>This will unitialize a Joystick. After this the Pygame event queue will -no longer receive events from the device.</p> -<p>It is safe to call this more than once.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_init"> -<tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the Joystick is initialized</span></div> -<div class="line"><span class="signature">get_init() -> bool</span></div> -</div> -<p>Returns True if the <tt class="docutils literal"><span class="pre">init()</span></tt> method has already been called on this -Joystick object.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_id"> -<tt class="descname">get_id</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_id" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the Joystick ID</span></div> -<div class="line"><span class="signature">get_id() -> int</span></div> -</div> -<p>Returns the integer <tt class="docutils literal"><span class="pre">ID</span></tt> that represents this device. This is the same -value that was passed to the <tt class="docutils literal"><span class="pre">Joystick()</span></tt> constructor. This method can -safely be called while the Joystick is not initialized.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_name"> -<tt class="descname">get_name</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_name" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the Joystick system name</span></div> -<div class="line"><span class="signature">get_name() -> string</span></div> -</div> -<p>Returns the system name for this joystick device. It is unknown what name -the system will give to the Joystick, but it should be a unique name that -identifies the device. This method can safely be called while the -Joystick is not initialized.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_numaxes"> -<tt class="descname">get_numaxes</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_numaxes" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the number of axes on a Joystick</span></div> -<div class="line"><span class="signature">get_numaxes() -> int</span></div> -</div> -<p>Returns the number of input axes are on a Joystick. There will usually be -two for the position. Controls like rudders and throttles are treated as -additional axes.</p> -<p>The <tt class="docutils literal"><span class="pre">pygame.JOYAXISMOTION</span></tt> events will be in the range from -1.0 to -1.0. A value of 0.0 means the axis is centered. Gamepad devices will -usually be -1, 0, or 1 with no values in between. Older analog joystick -axes will not always use the full -1 to 1 range, and the centered value -will be some area around 0. Analog joysticks usually have a bit of noise -in their axis, which will generate a lot of rapid small motion events.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_axis"> -<tt class="descname">get_axis</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_axis" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current position of an axis</span></div> -<div class="line"><span class="signature">get_axis(axis_number) -> float</span></div> -</div> -<p>Returns the current position of a joystick axis. The value will range -from -1 to 1 with a value of 0 being centered. You may want to take into -account some tolerance to handle jitter, and joystick drift may keep the -joystick from centering at 0 or using the full range of position values.</p> -<p>The axis number must be an integer from zero to get_numaxes()-1.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_numballs"> -<tt class="descname">get_numballs</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_numballs" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the number of trackballs on a Joystick</span></div> -<div class="line"><span class="signature">get_numballs() -> int</span></div> -</div> -<p>Returns the number of trackball devices on a Joystick. These devices work -similar to a mouse but they have no absolute position; they only have -relative amounts of movement.</p> -<p>The <tt class="docutils literal"><span class="pre">pygame.JOYBALLMOTION</span></tt> event will be sent when the trackball is -rolled. It will report the amount of movement on the trackball.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_ball"> -<tt class="descname">get_ball</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_ball" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the relative position of a trackball</span></div> -<div class="line"><span class="signature">get_ball(ball_number) -> x, y</span></div> -</div> -<p>Returns the relative movement of a joystick button. The value is a x, y -pair holding the relative movement since the last call to get_ball.</p> -<p>The ball number must be an integer from zero to get_numballs()-1.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_numbuttons"> -<tt class="descname">get_numbuttons</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_numbuttons" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the number of buttons on a Joystick</span></div> -<div class="line"><span class="signature">get_numbuttons() -> int</span></div> -</div> -<p>Returns the number of pushable buttons on the joystick. These buttons -have a boolean (on or off) state.</p> -<p>Buttons generate a <tt class="docutils literal"><span class="pre">pygame.JOYBUTTONDOWN</span></tt> and <tt class="docutils literal"><span class="pre">pygame.JOYBUTTONUP</span></tt> -event when they are pressed and released.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_button"> -<tt class="descname">get_button</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_button" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current button state</span></div> -<div class="line"><span class="signature">get_button(button) -> bool</span></div> -</div> -<p>Returns the current state of a joystick button.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_numhats"> -<tt class="descname">get_numhats</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_numhats" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the number of hat controls on a Joystick</span></div> -<div class="line"><span class="signature">get_numhats() -> int</span></div> -</div> -<p>Returns the number of joystick hats on a Joystick. Hat devices are like -miniature digital joysticks on a joystick. Each hat has two axes of -input.</p> -<p>The <tt class="docutils literal"><span class="pre">pygame.JOYHATMOTION</span></tt> event is generated when the hat changes -position. The position attribute for the event contains a pair of values -that are either -1, 0, or 1. A position of (0, 0) means the hat is -centered.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.joystick.Joystick.get_hat"> -<tt class="descname">get_hat</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.joystick.Joystick.get_hat" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the position of a joystick hat</span></div> -<div class="line"><span class="signature">get_hat(hat_number) -> x, y</span></div> -</div> -<p>Returns the current position of a position hat. The position is given as -two values representing the <tt class="docutils literal"><span class="pre">X</span></tt> and <tt class="docutils literal"><span class="pre">Y</span></tt> position for the hat. (0, 0) -means centered. A value of -1 means left/down and a value of 1 means -right/up: so (-1, 0) means left; (1, 0) means right; (0, 1) means up; (1, -1) means upper-right; etc.</p> -<p>This value is digital, <tt class="docutils literal"><span class="pre">i.e.</span></tt>, each coordinate can be -1, 0 or 1 but -never in-between.</p> -<p>The hat number must be between 0 and get_numhats()-1.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="key.html" title="pygame.key" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="image.html" title="pygame.image" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/key.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,417 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.key — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.locals" href="locals.html" /> - <link rel="prev" title="pygame.joystick" href="joystick.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.key"> -<span id="pygame-key"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.key</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module to work with the keyboard</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="24%" /> -<col width="1%" /> -<col width="74%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="key.html#pygame.key.get_focused">pygame.key.get_focused</a></td> -<td>—</td> -<td>true if the display is receiving keyboard input from the system</td> -</tr> -<tr><td><a class="toc reference external" href="key.html#pygame.key.get_pressed">pygame.key.get_pressed</a></td> -<td>—</td> -<td>get the state of all keyboard buttons</td> -</tr> -<tr><td><a class="toc reference external" href="key.html#pygame.key.get_mods">pygame.key.get_mods</a></td> -<td>—</td> -<td>determine which modifier keys are being held</td> -</tr> -<tr><td><a class="toc reference external" href="key.html#pygame.key.set_mods">pygame.key.set_mods</a></td> -<td>—</td> -<td>temporarily set which modifier keys are pressed</td> -</tr> -<tr><td><a class="toc reference external" href="key.html#pygame.key.set_repeat">pygame.key.set_repeat</a></td> -<td>—</td> -<td>control how held keys are repeated</td> -</tr> -<tr><td><a class="toc reference external" href="key.html#pygame.key.get_repeat">pygame.key.get_repeat</a></td> -<td>—</td> -<td>see how held keys are repeated</td> -</tr> -<tr><td><a class="toc reference external" href="key.html#pygame.key.name">pygame.key.name</a></td> -<td>—</td> -<td>get the name of a key identifier</td> -</tr> -</tbody> -</table> -<p>This module contains functions for dealing with the keyboard.</p> -<p>The event queue gets <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> and <tt class="docutils literal"><span class="pre">pygame.KEYUP</span></tt> events when the -keyboard buttons are pressed and released. Both events have a key attribute -that is a integer id representing every key on the keyboard.</p> -<p>The <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> event has an additional attributes unicode, and -scancode. unicode represents a single character string that is the fully -translated character entered. This takes into account the shift and composition -keys. scancode represents the platform specific key code. This could be -different from keyboard to keyboard, but is useful for key selection of weird -keys like the multimedia keys.</p> -<p>There are many keyboard constants, they are used to represent keys on the -keyboard. The following is a list of all keyboard constants</p> -<div class="highlight-python"><pre>KeyASCII ASCII Common Name -K_BACKSPACE \b backspace -K_TAB \t tab -K_CLEAR clear -K_RETURN \r return -K_PAUSE pause -K_ESCAPE ^[ escape -K_SPACE space -K_EXCLAIM ! exclaim -K_QUOTEDBL " quotedbl -K_HASH # hash -K_DOLLAR $ dollar -K_AMPERSAND & ampersand -K_QUOTE quote -K_LEFTPAREN ( left parenthesis -K_RIGHTPAREN ) right parenthesis -K_ASTERISK * asterisk -K_PLUS + plus sign -K_COMMA , comma -K_MINUS - minus sign -K_PERIOD . period -K_SLASH / forward slash -K_0 0 0 -K_1 1 1 -K_2 2 2 -K_3 3 3 -K_4 4 4 -K_5 5 5 -K_6 6 6 -K_7 7 7 -K_8 8 8 -K_9 9 9 -K_COLON : colon -K_SEMICOLON ; semicolon -K_LESS < less-than sign -K_EQUALS = equals sign -K_GREATER > greater-than sign -K_QUESTION ? question mark -K_AT @ at -K_LEFTBRACKET [ left bracket -K_BACKSLASH \ backslash -K_RIGHTBRACKET ] right bracket -K_CARET ^ caret -K_UNDERSCORE _ underscore -K_BACKQUOTE ` grave -K_a a a -K_b b b -K_c c c -K_d d d -K_e e e -K_f f f -K_g g g -K_h h h -K_i i i -K_j j j -K_k k k -K_l l l -K_m m m -K_n n n -K_o o o -K_p p p -K_q q q -K_r r r -K_s s s -K_t t t -K_u u u -K_v v v -K_w w w -K_x x x -K_y y y -K_z z z -K_DELETE delete -K_KP0 keypad 0 -K_KP1 keypad 1 -K_KP2 keypad 2 -K_KP3 keypad 3 -K_KP4 keypad 4 -K_KP5 keypad 5 -K_KP6 keypad 6 -K_KP7 keypad 7 -K_KP8 keypad 8 -K_KP9 keypad 9 -K_KP_PERIOD . keypad period -K_KP_DIVIDE / keypad divide -K_KP_MULTIPLY * keypad multiply -K_KP_MINUS - keypad minus -K_KP_PLUS + keypad plus -K_KP_ENTER \r keypad enter -K_KP_EQUALS = keypad equals -K_UP up arrow -K_DOWN down arrow -K_RIGHT right arrow -K_LEFT left arrow -K_INSERT insert -K_HOME home -K_END end -K_PAGEUP page up -K_PAGEDOWN page down -K_F1 F1 -K_F2 F2 -K_F3 F3 -K_F4 F4 -K_F5 F5 -K_F6 F6 -K_F7 F7 -K_F8 F8 -K_F9 F9 -K_F10 F10 -K_F11 F11 -K_F12 F12 -K_F13 F13 -K_F14 F14 -K_F15 F15 -K_NUMLOCK numlock -K_CAPSLOCK capslock -K_SCROLLOCK scrollock -K_RSHIFT right shift -K_LSHIFT left shift -K_RCTRL right ctrl -K_LCTRL left ctrl -K_RALT right alt -K_LALT left alt -K_RMETA right meta -K_LMETA left meta -K_LSUPER left windows key -K_RSUPER right windows key -K_MODE mode shift -K_HELP help -K_PRINT print screen -K_SYSREQ sysrq -K_BREAK break -K_MENU menu -K_POWER power -K_EURO euro</pre> -</div> -<p>The keyboard also has a list of modifier states that can be assembled bit -bitwise ORing them together.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">KMOD_NONE</span><span class="p">,</span> <span class="n">KMOD_LSHIFT</span><span class="p">,</span> <span class="n">KMOD_RSHIFT</span><span class="p">,</span> <span class="n">KMOD_SHIFT</span><span class="p">,</span> <span class="n">KMOD_CAPS</span><span class="p">,</span> -<span class="n">KMOD_LCTRL</span><span class="p">,</span> <span class="n">KMOD_RCTRL</span><span class="p">,</span> <span class="n">KMOD_CTRL</span><span class="p">,</span> <span class="n">KMOD_LALT</span><span class="p">,</span> <span class="n">KMOD_RALT</span><span class="p">,</span> -<span class="n">KMOD_ALT</span><span class="p">,</span> <span class="n">KMOD_LMETA</span><span class="p">,</span> <span class="n">KMOD_RMETA</span><span class="p">,</span> <span class="n">KMOD_META</span><span class="p">,</span> <span class="n">KMOD_NUM</span><span class="p">,</span> <span class="n">KMOD_MODE</span> -</pre></div> -</div> -<dl class="definition function"> -<dt class="title" id="pygame.key.get_focused"> -<tt class="descclassname">pygame.key.</tt><tt class="descname">get_focused</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.key.get_focused" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">true if the display is receiving keyboard input from the system</span></div> -<div class="line"><span class="signature">get_focused() -> bool</span></div> -</div> -<p>This is true when the display window has keyboard focus from the system. If -the display needs to ensure it does not lose keyboard focus, it can use -<tt class="docutils literal"><span class="pre">pygame.event.set_grab()</span></tt> to grab all input.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.key.get_pressed"> -<tt class="descclassname">pygame.key.</tt><tt class="descname">get_pressed</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.key.get_pressed" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the state of all keyboard buttons</span></div> -<div class="line"><span class="signature">get_pressed() -> bools</span></div> -</div> -<p>Returns a sequence of boolean values representing the state of every key on -the keyboard. Use the key constant values to index the array. A True value -means the that button is pressed.</p> -<p>Getting the list of pushed buttons with this function is not the proper way -to handle text entry from the user. You have no way to know the order of -keys pressed, and rapidly pushed keys can be completely unnoticed between -two calls to <tt class="docutils literal"><span class="pre">pygame.key.get_pressed()</span></tt>. There is also no way to translate -these pushed keys into a fully translated character value. See the -<tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> events on the event queue for this functionality.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.key.get_mods"> -<tt class="descclassname">pygame.key.</tt><tt class="descname">get_mods</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.key.get_mods" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">determine which modifier keys are being held</span></div> -<div class="line"><span class="signature">get_mods() -> int</span></div> -</div> -<p>Returns a single integer representing a bitmask of all the modifier keys -being held. Using bitwise operators you can test if specific shift keys are -pressed, the state of the capslock button, and more.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.key.set_mods"> -<tt class="descclassname">pygame.key.</tt><tt class="descname">set_mods</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.key.set_mods" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">temporarily set which modifier keys are pressed</span></div> -<div class="line"><span class="signature">set_mods(int) -> None</span></div> -</div> -<p>Create a bitmask of the modifier constants you want to impose on your -program.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.key.set_repeat"> -<tt class="descclassname">pygame.key.</tt><tt class="descname">set_repeat</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.key.set_repeat" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">control how held keys are repeated</span></div> -<div class="line"><span class="signature">set_repeat() -> None</span></div> -<div class="line"><span class="signature">set_repeat(delay, interval) -> None</span></div> -</div> -<p>When the keyboard repeat is enabled, keys that are held down will generate -multiple <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> events. The delay is the number of milliseconds -before the first repeated <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> will be sent. After that -another <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> will be sent every interval milliseconds. If no -arguments are passed the key repeat is disabled.</p> -<p>When pygame is initialized the key repeat is disabled.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.key.get_repeat"> -<tt class="descclassname">pygame.key.</tt><tt class="descname">get_repeat</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.key.get_repeat" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">see how held keys are repeated</span></div> -<div class="line"><span class="signature">get_repeat() -> (delay, interval)</span></div> -</div> -<p>When the keyboard repeat is enabled, keys that are held down will generate -multiple <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> events. The delay is the number of milliseconds -before the first repeated <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> will be sent. After that -another <tt class="docutils literal"><span class="pre">pygame.KEYDOWN</span></tt> will be sent every interval milliseconds.</p> -<p>When pygame is initialized the key repeat is disabled.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.key.name"> -<tt class="descclassname">pygame.key.</tt><tt class="descname">name</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.key.name" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the name of a key identifier</span></div> -<div class="line"><span class="signature">name(key) -> string</span></div> -</div> -<p>Get the descriptive name of the button from a keyboard button id constant.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="locals.html" title="pygame.locals" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="joystick.html" title="pygame.joystick" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/locals.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.locals — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.mask" href="mask.html" /> - <link rel="prev" title="pygame.key" href="key.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.locals"> -<span id="pygame-locals"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.locals</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame constants</span></div> -</div> -<p>This module contains various constants used by Pygame. It’s contents are -automatically placed in the pygame module namespace. However, an application -can use <a class="tooltip reference internal" href="#module-pygame.locals" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.locals</span></tt><span class="tooltip-content">pygame constants</span></a> to include only the Pygame constants with a ‘from -<a class="tooltip reference internal" href="#module-pygame.locals" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.locals</span></tt><span class="tooltip-content">pygame constants</span></a> import *’.</p> -<p>Detailed descriptions of the various constants are found throughout the Pygame -documentation. <a class="tooltip reference internal" href="display.html#pygame.display.set_mode" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.display.set_mode()</span></tt><span class="tooltip-content">initialize a window or screen for display</span></a> flags like <tt class="docutils literal"><span class="pre">HWSURFACE</span></tt> are -found in the Display section. Event types are explained in the Event section. -Keyboard <tt class="docutils literal"><span class="pre">K_</span></tt> constants relating to the key attribute of a <tt class="docutils literal"><span class="pre">KEYDOWN</span></tt> or -<tt class="docutils literal"><span class="pre">KEYUP</span></tt> event are listed in the Key section. Also found there are the various -<tt class="docutils literal"><span class="pre">MOD_</span></tt> key modifiers. Finally, <tt class="docutils literal"><span class="pre">TIMER_RESOLUTION</span></tt> is defined in Time.</p> -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="mask.html" title="pygame.mask" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="key.html" title="pygame.key" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/mask.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,520 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.mask — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.math" href="math.html" /> - <link rel="prev" title="pygame.locals" href="locals.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.mask"> -<span id="pygame-mask"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.mask</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for image masks.</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="35%" /> -<col width="1%" /> -<col width="64%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a></td> -<td>—</td> -<td>Returns a Mask from the given surface.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.from_threshold">pygame.mask.from_threshold</a></td> -<td>—</td> -<td>Creates a mask by thresholding Surfaces</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask">pygame.mask.Mask</a></td> -<td>—</td> -<td>pygame object for representing 2d bitmasks</td> -</tr> -</tbody> -</table> -<p>Useful for fast pixel perfect collision detection. A Mask uses 1bit per pixel -to store which parts collide.</p> -<p>New in pygame 1.8.</p> -<dl class="definition function"> -<dt class="title" id="pygame.mask.from_surface"> -<tt class="descclassname">pygame.mask.</tt><tt class="descname">from_surface</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.from_surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns a Mask from the given surface.</span></div> -<div class="line"><span class="signature">from_surface(Surface, threshold = 127) -> Mask</span></div> -</div> -<p>Makes the transparent parts of the Surface not set, and the opaque parts -set.</p> -<p>The alpha of each pixel is checked to see if it is greater than the given -threshold.</p> -<p>If the Surface is color keyed, then threshold is not used.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mask.from_threshold"> -<tt class="descclassname">pygame.mask.</tt><tt class="descname">from_threshold</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.from_threshold" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Creates a mask by thresholding Surfaces</span></div> -<div class="line"><span class="signature">from_threshold(Surface, color, threshold = (0,0,0,255), othersurface = None, palette_colors = 1) -> Mask</span></div> -</div> -<p>This is a more featureful method of getting a Mask from a Surface. If -supplied with only one Surface, all pixels within the threshold of the -supplied color are set in the Mask. If given the optional othersurface, all -pixels in Surface that are within the threshold of the corresponding pixel -in othersurface are set in the Mask.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.mask.Mask"> -<em class="property">class </em><tt class="descclassname">pygame.mask.</tt><tt class="descname">Mask</tt><a class="headerlink" href="#pygame.mask.Mask" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame object for representing 2d bitmasks</span></div> -<div class="line"><span class="signature">Mask((width, height)) -> Mask</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="24%" /> -<col width="1%" /> -<col width="75%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.get_size">pygame.mask.Mask.get_size</a></td> -<td>—</td> -<td>Returns the size of the mask.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.get_at">pygame.mask.Mask.get_at</a></td> -<td>—</td> -<td>Returns nonzero if the bit at (x,y) is set.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.set_at">pygame.mask.Mask.set_at</a></td> -<td>—</td> -<td>Sets the position in the mask given by x and y.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.overlap">pygame.mask.Mask.overlap</a></td> -<td>—</td> -<td>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.overlap_area">pygame.mask.Mask.overlap_area</a></td> -<td>—</td> -<td>Returns the number of overlapping ‘pixels’.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.overlap_mask">pygame.mask.Mask.overlap_mask</a></td> -<td>—</td> -<td>Returns a mask of the overlapping pixels</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.fill">pygame.mask.Mask.fill</a></td> -<td>—</td> -<td>Sets all bits to 1</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.clear">pygame.mask.Mask.clear</a></td> -<td>—</td> -<td>Sets all bits to 0</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.invert">pygame.mask.Mask.invert</a></td> -<td>—</td> -<td>Flips the bits in a Mask</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.scale">pygame.mask.Mask.scale</a></td> -<td>—</td> -<td>Resizes a mask</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.draw">pygame.mask.Mask.draw</a></td> -<td>—</td> -<td>Draws a mask onto another</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.erase">pygame.mask.Mask.erase</a></td> -<td>—</td> -<td>Erases a mask from another</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.count">pygame.mask.Mask.count</a></td> -<td>—</td> -<td>Returns the number of set pixels</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.centroid">pygame.mask.Mask.centroid</a></td> -<td>—</td> -<td>Returns the centroid of the pixels in a Mask</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.angle">pygame.mask.Mask.angle</a></td> -<td>—</td> -<td>Returns the orientation of the pixels</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.outline">pygame.mask.Mask.outline</a></td> -<td>—</td> -<td>list of points outlining an object</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.convolve">pygame.mask.Mask.convolve</a></td> -<td>—</td> -<td>Return the convolution of self with another mask.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.connected_component">pygame.mask.Mask.connected_component</a></td> -<td>—</td> -<td>Returns a mask of a connected region of pixels.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.connected_components">pygame.mask.Mask.connected_components</a></td> -<td>—</td> -<td>Returns a list of masks of connected regions of pixels.</td> -</tr> -<tr><td><a class="toc reference external" href="mask.html#pygame.mask.Mask.get_bounding_rects">pygame.mask.Mask.get_bounding_rects</a></td> -<td>—</td> -<td>Returns a list of bounding rects of regions of set pixels.</td> -</tr> -</tbody> -</table> -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.get_size"> -<tt class="descname">get_size</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.get_size" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the size of the mask.</span></div> -<div class="line"><span class="signature">get_size() -> width,height</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.get_at"> -<tt class="descname">get_at</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.get_at" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns nonzero if the bit at (x,y) is set.</span></div> -<div class="line"><span class="signature">get_at((x,y)) -> int</span></div> -</div> -<p>Coordinates start at (0,0) is top left - just like Surfaces.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.set_at"> -<tt class="descname">set_at</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.set_at" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets the position in the mask given by x and y.</span></div> -<div class="line"><span class="signature">set_at((x,y),value) -> None</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.overlap"> -<tt class="descname">overlap</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.overlap" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</span></div> -<div class="line"><span class="signature">overlap(othermask, offset) -> x,y</span></div> -</div> -<p>The overlap tests uses the following offsets (which may be negative):</p> -<div class="highlight-python"><pre>+----+----------.. -|A | yoffset -| +-+----------.. -+--|B -|xoffset -| | -: :</pre> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.overlap_area"> -<tt class="descname">overlap_area</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.overlap_area" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the number of overlapping ‘pixels’.</span></div> -<div class="line"><span class="signature">overlap_area(othermask, offset) -> numpixels</span></div> -</div> -<p>You can see how many pixels overlap with the other mask given. This can -be used to see in which direction things collide, or to see how much the -two masks collide. An approximate collision normal can be found by -calculating the gradient of the overlap area through the finite -difference.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">dx</span> <span class="o">=</span> <span class="n">Mask</span><span class="o">.</span><span class="n">overlap_area</span><span class="p">(</span><span class="n">othermask</span><span class="p">,(</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span><span class="n">y</span><span class="p">))</span> <span class="o">-</span> <span class="n">Mask</span><span class="o">.</span><span class="n">overlap_area</span><span class="p">(</span><span class="n">othermask</span><span class="p">,(</span><span class="n">x</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">y</span><span class="p">))</span> -<span class="n">dy</span> <span class="o">=</span> <span class="n">Mask</span><span class="o">.</span><span class="n">overlap_area</span><span class="p">(</span><span class="n">othermask</span><span class="p">,(</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="o">+</span><span class="mi">1</span><span class="p">))</span> <span class="o">-</span> <span class="n">Mask</span><span class="o">.</span><span class="n">overlap_area</span><span class="p">(</span><span class="n">othermask</span><span class="p">,(</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.overlap_mask"> -<tt class="descname">overlap_mask</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.overlap_mask" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns a mask of the overlapping pixels</span></div> -<div class="line"><span class="signature">overlap_mask(othermask, offset) -> Mask</span></div> -</div> -<p>Returns a Mask the size of the original Mask containing only the -overlapping pixels between Mask and othermask.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.fill"> -<tt class="descname">fill</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.fill" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets all bits to 1</span></div> -<div class="line"><span class="signature">fill() -> None</span></div> -</div> -<p>Sets all bits in a Mask to 1.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.clear"> -<tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.clear" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets all bits to 0</span></div> -<div class="line"><span class="signature">clear() -> None</span></div> -</div> -<p>Sets all bits in a Mask to 0.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.invert"> -<tt class="descname">invert</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.invert" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Flips the bits in a Mask</span></div> -<div class="line"><span class="signature">invert() -> None</span></div> -</div> -<p>Flips all of the bits in a Mask, so that the set pixels turn to unset -pixels and the unset pixels turn to set pixels.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.scale"> -<tt class="descname">scale</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.scale" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Resizes a mask</span></div> -<div class="line"><span class="signature">scale((x, y)) -> Mask</span></div> -</div> -<p>Returns a new Mask of the Mask scaled to the requested size.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.draw"> -<tt class="descname">draw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.draw" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Draws a mask onto another</span></div> -<div class="line"><span class="signature">draw(othermask, offset) -> None</span></div> -</div> -<p>Performs a bitwise <tt class="docutils literal"><span class="pre">OR</span></tt>, drawing othermask onto Mask.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.erase"> -<tt class="descname">erase</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.erase" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Erases a mask from another</span></div> -<div class="line"><span class="signature">erase(othermask, offset) -> None</span></div> -</div> -<p>Erases all pixels set in othermask from Mask.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.count"> -<tt class="descname">count</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.count" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the number of set pixels</span></div> -<div class="line"><span class="signature">count() -> pixels</span></div> -</div> -<p>Returns the number of set pixels in the Mask.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.centroid"> -<tt class="descname">centroid</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.centroid" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the centroid of the pixels in a Mask</span></div> -<div class="line"><span class="signature">centroid() -> (x, y)</span></div> -</div> -<p>Finds the centroid, the center of pixel mass, of a Mask. Returns a -coordinate tuple for the centroid of the Mask. In the event the Mask is -empty, it will return (0,0).</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.angle"> -<tt class="descname">angle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.angle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the orientation of the pixels</span></div> -<div class="line"><span class="signature">angle() -> theta</span></div> -</div> -<p>Finds the approximate orientation of the pixels in the image from -90 to -90 degrees. This works best if performed on one connected component of -pixels. It will return 0.0 on an empty Mask.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.outline"> -<tt class="descname">outline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.outline" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">list of points outlining an object</span></div> -<div class="line"><span class="signature">outline(every = 1) -> [(x,y), (x,y) ...]</span></div> -</div> -<p>Returns a list of points of the outline of the first object it comes -across in a Mask. For this to be useful, there should probably only be -one connected component of pixels in the Mask. The every option allows -you to skip pixels in the outline. For example, setting it to 10 would -return a list of every 10th pixel in the outline.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.convolve"> -<tt class="descname">convolve</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.convolve" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Return the convolution of self with another mask.</span></div> -<div class="line"><span class="signature">convolve(othermask, outputmask = None, offset = (0,0)) -> Mask</span></div> -</div> -<p>Returns a mask with the (i-offset[0],j-offset[1]) bit set if shifting -othermask so that it’s lower right corner pixel is at (i,j) would cause -it to overlap with self.</p> -<p>If an outputmask is specified, the output is drawn onto outputmask and -outputmask is returned. Otherwise a mask of size <tt class="docutils literal"><span class="pre">self.get_size()</span></tt> + -<tt class="docutils literal"><span class="pre">othermask.get_size()</span></tt> - (1,1) is created.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.connected_component"> -<tt class="descname">connected_component</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.connected_component" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns a mask of a connected region of pixels.</span></div> -<div class="line"><span class="signature">connected_component((x,y) = None) -> Mask</span></div> -</div> -<p>This uses the <tt class="docutils literal"><span class="pre">SAUF</span></tt> algorithm to find a connected component in the -Mask. It checks 8 point connectivity. By default, it will return the -largest connected component in the image. Optionally, a coordinate pair -of a pixel can be specified, and the connected component containing it -will be returned. In the event the pixel at that location is not set, the -returned Mask will be empty. The Mask returned is the same size as the -original Mask.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.connected_components"> -<tt class="descname">connected_components</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.connected_components" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns a list of masks of connected regions of pixels.</span></div> -<div class="line"><span class="signature">connected_components(min = 0) -> [Masks]</span></div> -</div> -<p>Returns a list of masks of connected regions of pixels. An optional -minimum number of pixels per connected region can be specified to filter -out noise.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mask.Mask.get_bounding_rects"> -<tt class="descname">get_bounding_rects</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mask.Mask.get_bounding_rects" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns a list of bounding rects of regions of set pixels.</span></div> -<div class="line"><span class="signature">get_bounding_rects() -> Rects</span></div> -</div> -<p>This gets a bounding rect of connected regions of set pixels. A bounding -rect is one for which each of the connected pixels is inside the rect.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="math.html" title="pygame.math" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="locals.html" title="pygame.locals" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/math.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,923 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.math — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.midi" href="midi.html" /> - <link rel="prev" title="pygame.mask" href="mask.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.math"> -<span id="pygame-math"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.math</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for vector classes</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="38%" /> -<col width="1%" /> -<col width="61%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="math.html#pygame.math.enable_swizzling">pygame.math.enable_swizzling</a></td> -<td>—</td> -<td>globally enables swizzling for vectors.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.disable_swizzling">pygame.math.disable_swizzling</a></td> -<td>—</td> -<td>globally disables swizzling for vectors.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2">pygame.math.Vector2</a></td> -<td>—</td> -<td>a 2-Dimensional Vector</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3">pygame.math.Vector3</a></td> -<td>—</td> -<td>a 3-Dimensional Vector</td> -</tr> -</tbody> -</table> -<p>!!!EXPERIMENTAL!!! Note: This Modul is still in development and the <tt class="docutils literal"><span class="pre">API</span></tt> -might change. Please report bug and suggestions to <a class="reference external" href="mailto:pygame-users%40seul.org">pygame-users<span>@</span>seul<span>.</span>org</a></p> -<p>The pygame math module currently provides Vector classes in two and three -dimensions, Vector2 and Vector3 respectively.</p> -<p>They support the following numerical operations: vec+vec, vec-vec, vec*number, -number*vec, vec/number, vec//number, vec+=vec, vec-=vec, vec*=number, -vec/=number, vec//=number. All these operations will be performed elementwise. -In addition vec*vec will perform a scalar-product (a.k.a. dot-product). If you -want to multiply every element from vector v with every element from vector w -you can use the elementwise method: <tt class="docutils literal"><span class="pre">v.elementwise()</span></tt> <tt class="docutils literal"><span class="pre">\*</span></tt> w</p> -<p>New in Pygame 1.10</p> -<dl class="definition function"> -<dt class="title" id="pygame.math.enable_swizzling"> -<tt class="descclassname">pygame.math.</tt><tt class="descname">enable_swizzling</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.enable_swizzling" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">globally enables swizzling for vectors.</span></div> -<div class="line"><span class="signature">enable_swizzling() -> None</span></div> -</div> -<p>Enables swizzling for all vectors until <tt class="docutils literal"><span class="pre">disable_swizzling()</span></tt> is called. -By default swizzling is disabled.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.math.disable_swizzling"> -<tt class="descclassname">pygame.math.</tt><tt class="descname">disable_swizzling</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.disable_swizzling" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">globally disables swizzling for vectors.</span></div> -<div class="line"><span class="signature">disable_swizzling() -> None</span></div> -</div> -<p>Disables swizzling for all vectors until <tt class="docutils literal"><span class="pre">enable_swizzling()</span></tt> is called. -By default swizzling is disabled.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.math.Vector2"> -<em class="property">class </em><tt class="descclassname">pygame.math.</tt><tt class="descname">Vector2</tt><a class="headerlink" href="#pygame.math.Vector2" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">a 2-Dimensional Vector</span></div> -<div class="line"><span class="signature">Vector2() -> Vector2</span></div> -<div class="line"><span class="signature">Vector2(Vector2) -> Vector2</span></div> -<div class="line"><span class="signature">Vector2(x, y) -> Vector2</span></div> -<div class="line"><span class="signature">Vector2((x, y)) -> Vector2</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="37%" /> -<col width="1%" /> -<col width="62%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.dot">pygame.math.Vector2.dot</a></td> -<td>—</td> -<td>calculates the dot- or scalar-product with the other vector</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.cross">pygame.math.Vector2.cross</a></td> -<td>—</td> -<td>calculates the cross- or vector-product</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.length">pygame.math.Vector2.length</a></td> -<td>—</td> -<td>returns the euclidic length of the vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.length_squared">pygame.math.Vector2.length_squared</a></td> -<td>—</td> -<td>returns the squared euclidic length of the vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.normalize">pygame.math.Vector2.normalize</a></td> -<td>—</td> -<td>returns a vector with the same direction but length 1.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.normalize_ip">pygame.math.Vector2.normalize_ip</a></td> -<td>—</td> -<td>normalizes the vector in place so that its length is 1.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.is_normalized">pygame.math.Vector2.is_normalized</a></td> -<td>—</td> -<td>tests if the vector is normalized i.e. has length == 1.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.scale_to_length">pygame.math.Vector2.scale_to_length</a></td> -<td>—</td> -<td>scales the vector to a given length.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.reflect">pygame.math.Vector2.reflect</a></td> -<td>—</td> -<td>returns a vector reflected of a given normal.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.reflect_ip">pygame.math.Vector2.reflect_ip</a></td> -<td>—</td> -<td>reflect the vector of a given normal in place.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.distance_to">pygame.math.Vector2.distance_to</a></td> -<td>—</td> -<td>calculates the euclidic distance to a given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.distance_squared_to">pygame.math.Vector2.distance_squared_to</a></td> -<td>—</td> -<td>calculates the squared euclidic distance to a given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.lerp">pygame.math.Vector2.lerp</a></td> -<td>—</td> -<td>returns a linear interpolation to the given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.slerp">pygame.math.Vector2.slerp</a></td> -<td>—</td> -<td>returns a spherical interpolation to the given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.elementwise">pygame.math.Vector2.elementwise</a></td> -<td>—</td> -<td>The next operation will be performed elementwize.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.rotate">pygame.math.Vector2.rotate</a></td> -<td>—</td> -<td>rotates a vector by a given angle in degrees.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.rotate_ip">pygame.math.Vector2.rotate_ip</a></td> -<td>—</td> -<td>rotates the vector by a given angle in degrees in place.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.angle_to">pygame.math.Vector2.angle_to</a></td> -<td>—</td> -<td>calculates the angle to a given vector in degrees.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.as_polar">pygame.math.Vector2.as_polar</a></td> -<td>—</td> -<td>returns a tuple with radial distance and azimuthal angle.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector2.from_polar">pygame.math.Vector2.from_polar</a></td> -<td>—</td> -<td>Sets x and y from a polar coordinates tuple.</td> -</tr> -</tbody> -</table> -<p>Some general information about the Vector2 class.</p> -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.dot"> -<tt class="descname">dot</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.dot" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the dot- or scalar-product with the other vector</span></div> -<div class="line"><span class="signature">dot(Vector2) -> float</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.cross"> -<tt class="descname">cross</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.cross" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the cross- or vector-product</span></div> -<div class="line"><span class="signature">cross(Vector2) -> float</span></div> -</div> -<p>calculates the third component of the cross-product.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.length"> -<tt class="descname">length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the euclidic length of the vector.</span></div> -<div class="line"><span class="signature">length() -> float</span></div> -</div> -<p>calculates the euclidic length of the vector which follows from the -Pythagorean theorem: <tt class="docutils literal"><span class="pre">vec.length()</span></tt> == -<tt class="docutils literal"><span class="pre">math.sqrt(vec.x**2</span> <span class="pre">+</span> <span class="pre">vec.y**2)</span></tt></p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.length_squared"> -<tt class="descname">length_squared</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.length_squared" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the squared euclidic length of the vector.</span></div> -<div class="line"><span class="signature">length_squared() -> float</span></div> -</div> -<p>calculates the euclidic length of the vector which follows from the -Pythagorean theorem: <tt class="docutils literal"><span class="pre">vec.length_squared()</span></tt> == vec.x**2 + vec.y**2 This -is faster than <tt class="docutils literal"><span class="pre">vec.length()</span></tt> because it avoids the square root.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.normalize"> -<tt class="descname">normalize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.normalize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a vector with the same direction but length 1.</span></div> -<div class="line"><span class="signature">normalize() -> Vector2</span></div> -</div> -<p>Returns a new vector that has length == 1 and the same direction as self.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.normalize_ip"> -<tt class="descname">normalize_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.normalize_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">normalizes the vector in place so that its length is 1.</span></div> -<div class="line"><span class="signature">normalize_ip() -> None</span></div> -</div> -<p>Normalizes the vector so that it has length == 1. The direction of the -vector is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.is_normalized"> -<tt class="descname">is_normalized</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.is_normalized" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">tests if the vector is normalized i.e. has length == 1.</span></div> -<div class="line"><span class="signature">is_normalized() -> Bool</span></div> -</div> -<p>Returns True if the vector has length == 1. Otherwise it returns False.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.scale_to_length"> -<tt class="descname">scale_to_length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.scale_to_length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">scales the vector to a given length.</span></div> -<div class="line"><span class="signature">scale_to_length(float) -> None</span></div> -</div> -<p>Scales the vector so that it has the given length. The direction of the -vector is not changed. You can also scale to length 0. If the vector is -the zero vector (i.e. has length 0 thus no direction) an -ZeroDivisionError is raised.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.reflect"> -<tt class="descname">reflect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.reflect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a vector reflected of a given normal.</span></div> -<div class="line"><span class="signature">reflect(Vector2) -> Vector2</span></div> -</div> -<p>Returns a new vector that points in the direction as if self would bounce -of a surface characterized by the given surface normal. The length of the -new vector is the same as self’s.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.reflect_ip"> -<tt class="descname">reflect_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.reflect_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">reflect the vector of a given normal in place.</span></div> -<div class="line"><span class="signature">reflect_ip(Vector2) -> None</span></div> -</div> -<p>Changes the direction of self as if it would have been reflected of a -surface with the given surface normal.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.distance_to"> -<tt class="descname">distance_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.distance_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the euclidic distance to a given vector.</span></div> -<div class="line"><span class="signature">distance_to(Vector2) -> float</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.distance_squared_to"> -<tt class="descname">distance_squared_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.distance_squared_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the squared euclidic distance to a given vector.</span></div> -<div class="line"><span class="signature">distance_squared_to(Vector2) -> float</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.lerp"> -<tt class="descname">lerp</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.lerp" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a linear interpolation to the given vector.</span></div> -<div class="line"><span class="signature">lerp(Vector2, float) -> Vector2</span></div> -</div> -<p>Returns a Vector which is a linear interpolation between self and the -given Vector. The second parameter determines how far between self an -other the result is going to be. It must be a value between 0 and 1 where -0 means self an 1 means other will be returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.slerp"> -<tt class="descname">slerp</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.slerp" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a spherical interpolation to the given vector.</span></div> -<div class="line"><span class="signature">slerp(Vector2, float) -> Vector2</span></div> -</div> -<p>Calculates the spherical interpolation from self to the given Vector. The -second argument - often called t - must be in the range [-1, 1]. It -parametrizes where - in between the two vectors - the result should be. -If a negative value is given the interpolation will not take the -complement of the shortest path.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.elementwise"> -<tt class="descname">elementwise</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.elementwise" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The next operation will be performed elementwize.</span></div> -<div class="line"><span class="signature">elementwise() -> VectorElementwizeProxy</span></div> -</div> -<p>Applies the following operation to each element of the vector.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.rotate"> -<tt class="descname">rotate</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.rotate" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates a vector by a given angle in degrees.</span></div> -<div class="line"><span class="signature">rotate(float) -> Vector2</span></div> -</div> -<p>Returns a vector which has the same length as self but is rotated -counterclockwise by the given angle in degrees.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.rotate_ip"> -<tt class="descname">rotate_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.rotate_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates the vector by a given angle in degrees in place.</span></div> -<div class="line"><span class="signature">rotate_ip(float) -> None</span></div> -</div> -<p>Rotates the vector counterclockwise by the given angle in degrees. The -length of the vector is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.angle_to"> -<tt class="descname">angle_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.angle_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the angle to a given vector in degrees.</span></div> -<div class="line"><span class="signature">angle_to(Vector2) -> float</span></div> -</div> -<p>Returns the angle between self and the given vector.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.as_polar"> -<tt class="descname">as_polar</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.as_polar" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a tuple with radial distance and azimuthal angle.</span></div> -<div class="line"><span class="signature">as_polar() -> (r, phi)</span></div> -</div> -<p>Returns a tuple (r, phi) where r is the radial distance, and phi is the -azimuthal angle.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector2.from_polar"> -<tt class="descname">from_polar</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector2.from_polar" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets x and y from a polar coordinates tuple.</span></div> -<div class="line"><span class="signature">from_polar((r, phi)) -> None</span></div> -</div> -<p>Sets x and y from a tuple (r, phi) where r is the radial distance, and -phi is the azimuthal angle.</p> -</dd></dl> - -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.math.Vector3"> -<em class="property">class </em><tt class="descclassname">pygame.math.</tt><tt class="descname">Vector3</tt><a class="headerlink" href="#pygame.math.Vector3" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">a 3-Dimensional Vector</span></div> -<div class="line"><span class="signature">Vector3() -> Vector3</span></div> -<div class="line"><span class="signature">Vector3(Vector3) -> Vector3</span></div> -<div class="line"><span class="signature">Vector3(x, y, z) -> Vector3</span></div> -<div class="line"><span class="signature">Vector3((x, y, z)) -> Vector3</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="34%" /> -<col width="1%" /> -<col width="66%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.dot">pygame.math.Vector3.dot</a></td> -<td>—</td> -<td>calculates the dot- or scalar-product with the other vector</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.cross">pygame.math.Vector3.cross</a></td> -<td>—</td> -<td>calculates the cross- or vector-product</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.length">pygame.math.Vector3.length</a></td> -<td>—</td> -<td>returns the euclidic length of the vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.length_squared">pygame.math.Vector3.length_squared</a></td> -<td>—</td> -<td>returns the squared euclidic length of the vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.normalize">pygame.math.Vector3.normalize</a></td> -<td>—</td> -<td>returns a vector with the same direction but length 1.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.normalize_ip">pygame.math.Vector3.normalize_ip</a></td> -<td>—</td> -<td>normalizes the vector in place so that its length is 1.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.is_normalized">pygame.math.Vector3.is_normalized</a></td> -<td>—</td> -<td>tests if the vector is normalized i.e. has length == 1.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.scale_to_length">pygame.math.Vector3.scale_to_length</a></td> -<td>—</td> -<td>scales the vector to a given length.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.reflect">pygame.math.Vector3.reflect</a></td> -<td>—</td> -<td>returns a vector reflected of a given normal.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.reflect_ip">pygame.math.Vector3.reflect_ip</a></td> -<td>—</td> -<td>reflect the vector of a given normal in place.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.distance_to">pygame.math.Vector3.distance_to</a></td> -<td>—</td> -<td>calculates the euclidic distance to a given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.distance_squared_to">pygame.math.Vector3.distance_squared_to</a></td> -<td>—</td> -<td>calculates the squared euclidic distance to a given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.lerp">pygame.math.Vector3.lerp</a></td> -<td>—</td> -<td>returns a linear interpolation to the given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.slerp">pygame.math.Vector3.slerp</a></td> -<td>—</td> -<td>returns a spherical interpolation to the given vector.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.elementwise">pygame.math.Vector3.elementwise</a></td> -<td>—</td> -<td>The next operation will be performed elementwize.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate">pygame.math.Vector3.rotate</a></td> -<td>—</td> -<td>rotates a vector by a given angle in degrees.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate_ip">pygame.math.Vector3.rotate_ip</a></td> -<td>—</td> -<td>rotates the vector by a given angle in degrees in place.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate_x">pygame.math.Vector3.rotate_x</a></td> -<td>—</td> -<td>rotates a vector around the x-axis by the angle in degrees.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate_x_ip">pygame.math.Vector3.rotate_x_ip</a></td> -<td>—</td> -<td>rotates the vector around the x-axis by the angle in degrees in place.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate_y">pygame.math.Vector3.rotate_y</a></td> -<td>—</td> -<td>rotates a vector around the y-axis by the angle in degrees.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate_y_ip">pygame.math.Vector3.rotate_y_ip</a></td> -<td>—</td> -<td>rotates the vector around the y-axis by the angle in degrees in place.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate_z">pygame.math.Vector3.rotate_z</a></td> -<td>—</td> -<td>rotates a vector around the z-axis by the angle in degrees.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.rotate_z_ip">pygame.math.Vector3.rotate_z_ip</a></td> -<td>—</td> -<td>rotates the vector around the z-axis by the angle in degrees in place.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.angle_to">pygame.math.Vector3.angle_to</a></td> -<td>—</td> -<td>calculates the angle to a given vector in degrees.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.as_spherical">pygame.math.Vector3.as_spherical</a></td> -<td>—</td> -<td>returns a tuple with radial distance, inclination and azimuthal angle.</td> -</tr> -<tr><td><a class="toc reference external" href="math.html#pygame.math.Vector3.from_spherical">pygame.math.Vector3.from_spherical</a></td> -<td>—</td> -<td>Sets x, y and z from a spherical coordinates 3-tuple.</td> -</tr> -</tbody> -</table> -<p>Some general information about the Vector3 class.</p> -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.dot"> -<tt class="descname">dot</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.dot" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the dot- or scalar-product with the other vector</span></div> -<div class="line"><span class="signature">dot(Vector3) -> float</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.cross"> -<tt class="descname">cross</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.cross" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the cross- or vector-product</span></div> -<div class="line"><span class="signature">cross(Vector3) -> float</span></div> -</div> -<p>calculates the cross-product.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.length"> -<tt class="descname">length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the euclidic length of the vector.</span></div> -<div class="line"><span class="signature">length() -> float</span></div> -</div> -<p>calculates the euclidic length of the vector which follows from the -Pythagorean theorem: <tt class="docutils literal"><span class="pre">vec.length()</span></tt> == -<tt class="docutils literal"><span class="pre">math.sqrt(vec.x**2</span> <span class="pre">+</span> <span class="pre">vec.y**2</span> <span class="pre">+</span> <span class="pre">vec.z**2)</span></tt></p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.length_squared"> -<tt class="descname">length_squared</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.length_squared" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the squared euclidic length of the vector.</span></div> -<div class="line"><span class="signature">length_squared() -> float</span></div> -</div> -<p>calculates the euclidic length of the vector which follows from the -Pythagorean theorem: <tt class="docutils literal"><span class="pre">vec.length_squared()</span></tt> == vec.x**2 + vec.y**2 + -vec.z**2 This is faster than <tt class="docutils literal"><span class="pre">vec.length()</span></tt> because it avoids the -square root.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.normalize"> -<tt class="descname">normalize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.normalize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a vector with the same direction but length 1.</span></div> -<div class="line"><span class="signature">normalize() -> Vector3</span></div> -</div> -<p>Returns a new vector that has length == 1 and the same direction as self.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.normalize_ip"> -<tt class="descname">normalize_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.normalize_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">normalizes the vector in place so that its length is 1.</span></div> -<div class="line"><span class="signature">normalize_ip() -> None</span></div> -</div> -<p>Normalizes the vector so that it has length == 1. The direction of the -vector is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.is_normalized"> -<tt class="descname">is_normalized</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.is_normalized" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">tests if the vector is normalized i.e. has length == 1.</span></div> -<div class="line"><span class="signature">is_normalized() -> Bool</span></div> -</div> -<p>Returns True if the vector has length == 1. Otherwise it returns False.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.scale_to_length"> -<tt class="descname">scale_to_length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.scale_to_length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">scales the vector to a given length.</span></div> -<div class="line"><span class="signature">scale_to_length(float) -> None</span></div> -</div> -<p>Scales the vector so that it has the given length. The direction of the -vector is not changed. You can also scale to length 0. If the vector is -the zero vector (i.e. has length 0 thus no direction) an -ZeroDivisionError is raised.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.reflect"> -<tt class="descname">reflect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.reflect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a vector reflected of a given normal.</span></div> -<div class="line"><span class="signature">reflect(Vector3) -> Vector3</span></div> -</div> -<p>Returns a new vector that points in the direction as if self would bounce -of a surface characterized by the given surface normal. The length of the -new vector is the same as self’s.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.reflect_ip"> -<tt class="descname">reflect_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.reflect_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">reflect the vector of a given normal in place.</span></div> -<div class="line"><span class="signature">reflect_ip(Vector3) -> None</span></div> -</div> -<p>Changes the direction of self as if it would have been reflected of a -surface with the given surface normal.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.distance_to"> -<tt class="descname">distance_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.distance_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the euclidic distance to a given vector.</span></div> -<div class="line"><span class="signature">distance_to(Vector3) -> float</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.distance_squared_to"> -<tt class="descname">distance_squared_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.distance_squared_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the squared euclidic distance to a given vector.</span></div> -<div class="line"><span class="signature">distance_squared_to(Vector3) -> float</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.lerp"> -<tt class="descname">lerp</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.lerp" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a linear interpolation to the given vector.</span></div> -<div class="line"><span class="signature">lerp(Vector3, float) -> Vector3</span></div> -</div> -<p>Returns a Vector which is a linear interpolation between self and the -given Vector. The second parameter determines how far between self an -other the result is going to be. It must be a value between 0 and 1 where -0 means self an 1 means other will be returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.slerp"> -<tt class="descname">slerp</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.slerp" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a spherical interpolation to the given vector.</span></div> -<div class="line"><span class="signature">slerp(Vector3, float) -> Vector3</span></div> -</div> -<p>Calculates the spherical interpolation from self to the given Vector. The -second argument - often called t - must be in the range [-1, 1]. It -parametrizes where - in between the two vectors - the result should be. -If a negative value is given the interpolation will not take the -complement of the shortest path.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.elementwise"> -<tt class="descname">elementwise</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.elementwise" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">The next operation will be performed elementwize.</span></div> -<div class="line"><span class="signature">elementwise() -> VectorElementwizeProxy</span></div> -</div> -<p>Applies the following operation to each element of the vector.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate"> -<tt class="descname">rotate</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates a vector by a given angle in degrees.</span></div> -<div class="line"><span class="signature">rotate(Vector3, float) -> Vector3</span></div> -</div> -<p>Returns a vector which has the same length as self but is rotated -counterclockwise by the given angle in degrees around the given axis.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate_ip"> -<tt class="descname">rotate_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates the vector by a given angle in degrees in place.</span></div> -<div class="line"><span class="signature">rotate_ip(Vector3, float) -> None</span></div> -</div> -<p>Rotates the vector counterclockwise around the given axis by the given -angle in degrees. The length of the vector is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate_x"> -<tt class="descname">rotate_x</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate_x" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates a vector around the x-axis by the angle in degrees.</span></div> -<div class="line"><span class="signature">rotate_x(float) -> Vector3</span></div> -</div> -<p>Returns a vector which has the same length as self but is rotated -counterclockwise around the x-axis by the given angle in degrees.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate_x_ip"> -<tt class="descname">rotate_x_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate_x_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates the vector around the x-axis by the angle in degrees in place.</span></div> -<div class="line"><span class="signature">rotate_x_ip(float) -> None</span></div> -</div> -<p>Rotates the vector counterclockwise around the x-axis by the given angle -in degrees. The length of the vector is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate_y"> -<tt class="descname">rotate_y</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate_y" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates a vector around the y-axis by the angle in degrees.</span></div> -<div class="line"><span class="signature">rotate_y(float) -> Vector3</span></div> -</div> -<p>Returns a vector which has the same length as self but is rotated -counterclockwise around the y-axis by the given angle in degrees.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate_y_ip"> -<tt class="descname">rotate_y_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate_y_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates the vector around the y-axis by the angle in degrees in place.</span></div> -<div class="line"><span class="signature">rotate_y_ip(float) -> None</span></div> -</div> -<p>Rotates the vector counterclockwise around the y-axis by the given angle -in degrees. The length of the vector is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate_z"> -<tt class="descname">rotate_z</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate_z" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates a vector around the z-axis by the angle in degrees.</span></div> -<div class="line"><span class="signature">rotate_z(float) -> Vector3</span></div> -</div> -<p>Returns a vector which has the same length as self but is rotated -counterclockwise around the z-axis by the given angle in degrees.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.rotate_z_ip"> -<tt class="descname">rotate_z_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.rotate_z_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotates the vector around the z-axis by the angle in degrees in place.</span></div> -<div class="line"><span class="signature">rotate_z_ip(float) -> None</span></div> -</div> -<p>Rotates the vector counterclockwise around the z-axis by the given angle -in degrees. The length of the vector is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.angle_to"> -<tt class="descname">angle_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.angle_to" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">calculates the angle to a given vector in degrees.</span></div> -<div class="line"><span class="signature">angle_to(Vector3) -> float</span></div> -</div> -<p>Returns the angle between self and the given vector.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.as_spherical"> -<tt class="descname">as_spherical</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.as_spherical" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a tuple with radial distance, inclination and azimuthal angle.</span></div> -<div class="line"><span class="signature">as_spherical() -> (r, theta, phi)</span></div> -</div> -<p>Returns a tuple (r, theta, phi) where r is the radial distance, theta is -the inclination angle and phi is the azimuthal angle.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.math.Vector3.from_spherical"> -<tt class="descname">from_spherical</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.math.Vector3.from_spherical" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets x, y and z from a spherical coordinates 3-tuple.</span></div> -<div class="line"><span class="signature">from_spherical((r, theta, phi)) -> None</span></div> -</div> -<p>Sets x, y and z from a tuple (r, theta, phi) where r is the radial -distance, theta is the inclination angle and phi is the azimuthal angle.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="midi.html" title="pygame.midi" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="mask.html" title="pygame.mask" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/midi.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,617 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.midi — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.mixer" href="mixer.html" /> - <link rel="prev" title="pygame.math" href="math.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.midi"> -<span id="pygame-midi"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.midi</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for interacting with midi input and output.</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="34%" /> -<col width="1%" /> -<col width="65%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Input">pygame.midi.Input</a></td> -<td>—</td> -<td>Input is used to get midi input from midi devices.</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.MidiException">pygame.midi.MidiException</a></td> -<td>—</td> -<td>exception that pygame.midi functions and classes can raise</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output">pygame.midi.Output</a></td> -<td>—</td> -<td>Output is used to send midi to an output device</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.get_count">pygame.midi.get_count</a></td> -<td>—</td> -<td>gets the number of devices.</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.get_default_input_id">pygame.midi.get_default_input_id</a></td> -<td>—</td> -<td>gets default input device number</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.get_default_output_id">pygame.midi.get_default_output_id</a></td> -<td>—</td> -<td>gets default output device number</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.get_device_info">pygame.midi.get_device_info</a></td> -<td>—</td> -<td>returns information about a midi device</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.init">pygame.midi.init</a></td> -<td>—</td> -<td>initialize the midi module</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.midis2events">pygame.midi.midis2events</a></td> -<td>—</td> -<td>converts midi events to pygame events</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.quit">pygame.midi.quit</a></td> -<td>—</td> -<td>uninitialize the midi module</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.time">pygame.midi.time</a></td> -<td>—</td> -<td>returns the current time in ms of the PortMidi timer</td> -</tr> -</tbody> -</table> -<p>The midi module can send output to midi devices, and get input from midi -devices. It can also list midi devices on the system.</p> -<p>Including real midi devices, and virtual ones.</p> -<p>It uses the portmidi library. Is portable to which ever platforms portmidi -supports (currently windows, <tt class="docutils literal"><span class="pre">OSX</span></tt>, and linux).</p> -<p>This uses pyportmidi for now, but may use its own bindings at some point in the -future. The pyportmidi bindings are included with pygame.</p> -<p>New in pygame 1.9.0.</p> -<dl class="definition class"> -<dt class="title" id="pygame.midi.Input"> -<em class="property">class </em><tt class="descclassname">pygame.midi.</tt><tt class="descname">Input</tt><a class="headerlink" href="#pygame.midi.Input" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Input is used to get midi input from midi devices.</span></div> -<div class="line"><span class="signature">Input(device_id) -> None</span></div> -<div class="line"><span class="signature">Input(device_id, buffer_size) -> None</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="29%" /> -<col width="1%" /> -<col width="70%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Input.close">pygame.midi.Input.close</a></td> -<td>—</td> -<td>closes a midi stream, flushing any pending buffers.</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Input.poll">pygame.midi.Input.poll</a></td> -<td>—</td> -<td>returns true if there’s data, or false if not.</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Input.read">pygame.midi.Input.read</a></td> -<td>—</td> -<td>reads num_events midi events from the buffer.</td> -</tr> -</tbody> -</table> -<p>buffer_size -the number of input events to be buffered waiting to</p> -<div class="highlight-python"><pre>be read using Input.read()</pre> -</div> -<dl class="definition method"> -<dt class="title" id="pygame.midi.Input.close"> -<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Input.close" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">closes a midi stream, flushing any pending buffers.</span></div> -<div class="line"><span class="signature">close() -> None</span></div> -</div> -<p>PortMidi attempts to close open streams when the application exits – -this is particularly difficult under Windows.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Input.poll"> -<tt class="descname">poll</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Input.poll" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns true if there’s data, or false if not.</span></div> -<div class="line"><span class="signature">poll() -> Bool</span></div> -</div> -<p>raises a MidiException on error.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Input.read"> -<tt class="descname">read</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Input.read" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">reads num_events midi events from the buffer.</span></div> -<div class="line"><span class="signature">read(num_events) -> midi_event_list</span></div> -</div> -<p>Reads from the Input buffer and gives back midi events. -[[[status,data1,data2,data3],timestamp],</p> -<div class="highlight-python"><pre>[[status,data1,data2,data3],timestamp],...]</pre> -</div> -</dd></dl> - -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.MidiException"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">MidiException</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.MidiException" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">exception that pygame.midi functions and classes can raise</span></div> -<div class="line"><span class="signature">MidiException(errno) -> None</span></div> -</div> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.midi.Output"> -<em class="property">class </em><tt class="descclassname">pygame.midi.</tt><tt class="descname">Output</tt><a class="headerlink" href="#pygame.midi.Output" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Output is used to send midi to an output device</span></div> -<div class="line"><span class="signature">Output(device_id) -> None</span></div> -<div class="line"><span class="signature">Output(device_id, latency = 0) -> None</span></div> -<div class="line"><span class="signature">Output(device_id, buffer_size = 4096) -> None</span></div> -<div class="line"><span class="signature">Output(device_id, latency, buffer_size) -> None</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="36%" /> -<col width="1%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.abort">pygame.midi.Output.abort</a></td> -<td>—</td> -<td>terminates outgoing messages immediately</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.close">pygame.midi.Output.close</a></td> -<td>—</td> -<td>closes a midi stream, flushing any pending buffers.</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.note_off">pygame.midi.Output.note_off</a></td> -<td>—</td> -<td>turns a midi note off. Note must be on.</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.note_on">pygame.midi.Output.note_on</a></td> -<td>—</td> -<td>turns a midi note on. Note must be off.</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.set_instrument">pygame.midi.Output.set_instrument</a></td> -<td>—</td> -<td>select an instrument, with a value between 0 and 127</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.write">pygame.midi.Output.write</a></td> -<td>—</td> -<td>writes a list of midi data to the Output</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.write_short">pygame.midi.Output.write_short</a></td> -<td>—</td> -<td>write_short(status <, data1><, data2>)</td> -</tr> -<tr><td><a class="toc reference external" href="midi.html#pygame.midi.Output.write_sys_ex">pygame.midi.Output.write_sys_ex</a></td> -<td>—</td> -<td>writes a timestamped system-exclusive midi message.</td> -</tr> -</tbody> -</table> -<p>The buffer_size specifies the number of output events to be buffered waiting -for output. (In some cases – see below – PortMidi does not buffer output -at all and merely passes data to a lower-level <tt class="docutils literal"><span class="pre">API</span></tt>, in which case -buffersize is ignored.)</p> -<p>latency is the delay in milliseconds applied to timestamps to determine when -the output should actually occur. (If latency is <<0, 0 is assumed.)</p> -<p>If latency is zero, timestamps are ignored and all output is delivered -immediately. If latency is greater than zero, output is delayed until the -message timestamp plus the latency. (NOTE: time is measured relative to the -time source indicated by time_proc. Timestamps are absolute, not relative -delays or offsets.) In some cases, PortMidi can obtain better timing than -your application by passing timestamps along to the device driver or -hardware. Latency may also help you to synchronize midi data to audio data -by matching midi latency to the audio buffer latency.</p> -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.abort"> -<tt class="descname">abort</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.abort" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">terminates outgoing messages immediately</span></div> -<div class="line"><span class="signature">abort() -> None</span></div> -</div> -<p>The caller should immediately close the output port; this call may result -in transmission of a partial midi message. There is no abort for Midi -input because the user can simply ignore messages in the buffer and close -an input device at any time.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.close"> -<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.close" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">closes a midi stream, flushing any pending buffers.</span></div> -<div class="line"><span class="signature">close() -> None</span></div> -</div> -<p>PortMidi attempts to close open streams when the application exits – -this is particularly difficult under Windows.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.note_off"> -<tt class="descname">note_off</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.note_off" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">turns a midi note off. Note must be on.</span></div> -<div class="line"><span class="signature">note_off(note, velocity=None, channel = 0) -> None</span></div> -</div> -<p>Turn a note off in the output stream. The note must already be on for -this to work correctly.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.note_on"> -<tt class="descname">note_on</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.note_on" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">turns a midi note on. Note must be off.</span></div> -<div class="line"><span class="signature">note_on(note, velocity=None, channel = 0) -> None</span></div> -</div> -<p>Turn a note on in the output stream. The note must already be off for -this to work correctly.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.set_instrument"> -<tt class="descname">set_instrument</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.set_instrument" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">select an instrument, with a value between 0 and 127</span></div> -<div class="line"><span class="signature">set_instrument(instrument_id, channel = 0) -> None</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.write"> -<tt class="descname">write</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.write" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">writes a list of midi data to the Output</span></div> -<div class="line"><span class="signature">write(data) -> None</span></div> -</div> -<p>writes series of <tt class="docutils literal"><span class="pre">MIDI</span></tt> information in the form of a list:</p> -<div class="highlight-python"><pre>write([[[status <,data1><,data2><,data3>],timestamp], - [[status <,data1><,data2><,data3>],timestamp],...])</pre> -</div> -<p><<ata> fields are optional example: choose program change 1 at time 20000 -and send note 65 with velocity 100 500 ms later.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">write</span><span class="p">([[[</span><span class="mh">0xc0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">],</span><span class="mi">20000</span><span class="p">],[[</span><span class="mh">0x90</span><span class="p">,</span><span class="mi">60</span><span class="p">,</span><span class="mi">100</span><span class="p">],</span><span class="mi">20500</span><span class="p">]])</span> -</pre></div> -</div> -<p>notes:</p> -<div class="highlight-python"><pre>1. timestamps will be ignored if latency = 0. -2. To get a note to play immediately, send MIDI info with - timestamp read from function Time. -3. understanding optional data fields: - write([[[0xc0,0,0],20000]]) is equivalent to - write([[[0xc0],20000]])</pre> -</div> -<p>Can send up to 1024 elements in your data list, otherwise an</p> -<div class="highlight-python"><pre>IndexError exception is raised.</pre> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.write_short"> -<tt class="descname">write_short</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.write_short" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">write_short(status <, data1><, data2>)</span></div> -<div class="line"><span class="signature">write_short(status) -> None</span></div> -<div class="line"><span class="signature">write_short(status, data1 = 0, data2 = 0) -> None</span></div> -</div> -<p>output <tt class="docutils literal"><span class="pre">MIDI</span></tt> information of 3 bytes or less. data fields are optional -status byte could be:</p> -<div class="highlight-python"><pre>0xc0 = program change -0x90 = note on -etc. -data bytes are optional and assumed 0 if omitted</pre> -</div> -<p>example: note 65 on with velocity 100</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">write_short</span><span class="p">(</span><span class="mh">0x90</span><span class="p">,</span><span class="mi">65</span><span class="p">,</span><span class="mi">100</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.midi.Output.write_sys_ex"> -<tt class="descname">write_sys_ex</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.Output.write_sys_ex" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">writes a timestamped system-exclusive midi message.</span></div> -<div class="line"><span class="signature">write_sys_ex(when, msg) -> None</span></div> -</div> -<p>msg - can be a *list* or a *string* when - a timestamp in miliseconds -example:</p> -<div class="highlight-python"><pre>(assuming o is an onput MIDI stream) - o.write_sys_ex(0,'\xF0\x7D\x10\x11\x12\x13\xF7') -is equivalent to - o.write_sys_ex(pygame.midi.time(), - [0xF0,0x7D,0x10,0x11,0x12,0x13,0xF7])</pre> -</div> -</dd></dl> - -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.get_count"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">get_count</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.get_count" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">gets the number of devices.</span></div> -<div class="line"><span class="signature">get_count() -> num_devices</span></div> -</div> -<p>Device ids range from 0 to <tt class="docutils literal"><span class="pre">get_count()</span></tt> -1</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.get_default_input_id"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">get_default_input_id</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.get_default_input_id" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">gets default input device number</span></div> -<div class="line"><span class="signature">get_default_input_id() -> default_id</span></div> -</div> -<p>Return the default device <tt class="docutils literal"><span class="pre">ID</span></tt> or -1 if there are no devices. The result -can be passed to the Input()/Ouput() class.</p> -<p>On the <tt class="docutils literal"><span class="pre">PC</span></tt>, the user can specify a default device by setting an -environment variable. For example, to use device #1.</p> -<div class="highlight-python"><pre>set PM_RECOMMENDED_INPUT_DEVICE=1</pre> -</div> -<p>The user should first determine the available device <tt class="docutils literal"><span class="pre">ID</span></tt> by using the -supplied application “testin” or “testout”.</p> -<p>In general, the registry is a better place for this kind of info, and with -<tt class="docutils literal"><span class="pre">USB</span></tt> devices that can come and go, using integers is not very reliable -for device identification. Under Windows, if -<tt class="docutils literal"><span class="pre">PM_RECOMMENDED_OUTPUT_DEVICE</span></tt> (or <tt class="docutils literal"><span class="pre">PM_RECOMMENDED_INPUT_DEVICE</span></tt>) is -*NOT* found in the environment, then the default device is obtained by -looking for a string in the registry under:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">HKEY_LOCAL_MACHINE</span><span class="o">/</span><span class="n">SOFTWARE</span><span class="o">/</span><span class="n">PortMidi</span><span class="o">/</span><span class="n">Recommended_Input_Device</span> -</pre></div> -</div> -<p>and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device for a -string. The number of the first device with a substring that matches the -string exactly is returned. For example, if the string in the registry is -“USB”, and device 1 is named “In <tt class="docutils literal"><span class="pre">USB</span></tt> MidiSport 1x1”, then that will be -the default input because it contains the string “USB”.</p> -<p>In addition to the name, <tt class="docutils literal"><span class="pre">get_device_info()</span></tt> returns “interf”, which is -the interface name. (The “interface” is the underlying software system or -<tt class="docutils literal"><span class="pre">API</span></tt> used by PortMidi to access devices. Examples are MMSystem, DirectX -(not implemented), <tt class="docutils literal"><span class="pre">ALSA</span></tt>, <tt class="docutils literal"><span class="pre">OSS</span></tt> (not implemented), etc.) At present, -the only Win32 interface is “MMSystem”, the only Linux interface is “ALSA”, -and the only Max <tt class="docutils literal"><span class="pre">OS</span></tt> <tt class="docutils literal"><span class="pre">X</span></tt> interface is “CoreMIDI”. To specify both the -interface and the device name in the registry, separate the two with a comma -and a space, <tt class="docutils literal"><span class="pre">e.g.</span></tt>:</p> -<div class="highlight-python"><pre>MMSystem, In USB MidiSport 1x1</pre> -</div> -<p>In this case, the string before the comma must be a substring of the -“interf” string, and the string after the space must be a substring of the -“name” name string in order to match the device.</p> -<p>Note: in the current release, the default is simply the first device (the -input or output device with the lowest PmDeviceID).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.get_default_output_id"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">get_default_output_id</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.get_default_output_id" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">gets default output device number</span></div> -<div class="line"><span class="signature">get_default_output_id() -> default_id</span></div> -</div> -<p>Return the default device <tt class="docutils literal"><span class="pre">ID</span></tt> or -1 if there are no devices. The result -can be passed to the Input()/Ouput() class.</p> -<p>On the <tt class="docutils literal"><span class="pre">PC</span></tt>, the user can specify a default device by setting an -environment variable. For example, to use device #1.</p> -<div class="highlight-python"><pre>set PM_RECOMMENDED_OUTPUT_DEVICE=1</pre> -</div> -<p>The user should first determine the available device <tt class="docutils literal"><span class="pre">ID</span></tt> by using the -supplied application “testin” or “testout”.</p> -<p>In general, the registry is a better place for this kind of info, and with -<tt class="docutils literal"><span class="pre">USB</span></tt> devices that can come and go, using integers is not very reliable -for device identification. Under Windows, if -<tt class="docutils literal"><span class="pre">PM_RECOMMENDED_OUTPUT_DEVICE</span></tt> (or <tt class="docutils literal"><span class="pre">PM_RECOMMENDED_INPUT_DEVICE</span></tt>) is -*NOT* found in the environment, then the default device is obtained by -looking for a string in the registry under:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">HKEY_LOCAL_MACHINE</span><span class="o">/</span><span class="n">SOFTWARE</span><span class="o">/</span><span class="n">PortMidi</span><span class="o">/</span><span class="n">Recommended_Input_Device</span> -</pre></div> -</div> -<p>and HKEY_LOCAL_MACHINE/SOFTWARE/PortMidi/Recommended_Output_Device for a -string. The number of the first device with a substring that matches the -string exactly is returned. For example, if the string in the registry is -“USB”, and device 1 is named “In <tt class="docutils literal"><span class="pre">USB</span></tt> MidiSport 1x1”, then that will be -the default input because it contains the string “USB”.</p> -<p>In addition to the name, <tt class="docutils literal"><span class="pre">get_device_info()</span></tt> returns “interf”, which is -the interface name. (The “interface” is the underlying software system or -<tt class="docutils literal"><span class="pre">API</span></tt> used by PortMidi to access devices. Examples are MMSystem, DirectX -(not implemented), <tt class="docutils literal"><span class="pre">ALSA</span></tt>, <tt class="docutils literal"><span class="pre">OSS</span></tt> (not implemented), etc.) At present, -the only Win32 interface is “MMSystem”, the only Linux interface is “ALSA”, -and the only Max <tt class="docutils literal"><span class="pre">OS</span></tt> <tt class="docutils literal"><span class="pre">X</span></tt> interface is “CoreMIDI”. To specify both the -interface and the device name in the registry, separate the two with a comma -and a space, <tt class="docutils literal"><span class="pre">e.g.</span></tt>:</p> -<div class="highlight-python"><pre>MMSystem, In USB MidiSport 1x1</pre> -</div> -<p>In this case, the string before the comma must be a substring of the -“interf” string, and the string after the space must be a substring of the -“name” name string in order to match the device.</p> -<p>Note: in the current release, the default is simply the first device (the -input or output device with the lowest PmDeviceID).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.get_device_info"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">get_device_info</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.get_device_info" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns information about a midi device</span></div> -<div class="line"><span class="signature">get_device_info(an_id) -> (interf, name, input, output, opened)</span></div> -</div> -<p>interf - a text string describing the device interface, eg ‘ALSA’. name - a -text string for the name of the device, eg ‘Midi Through Port-0’ input - 0, -or 1 if the device is an input device. output - 0, or 1 if the device is an -output device. opened - 0, or 1 if the device is opened.</p> -<p>If the id is out of range, the function returns None.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.init"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize the midi module</span></div> -<div class="line"><span class="signature">init() -> None</span></div> -</div> -<p>Call the initialisation function before using the midi module.</p> -<p>It is safe to call this more than once.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.midis2events"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">midis2events</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.midis2events" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">converts midi events to pygame events</span></div> -<div class="line"><span class="signature">midis2events(midis, device_id) -> [Event, ...]</span></div> -</div> -<p>Takes a sequence of midi events and returns list of pygame events.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.quit"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize the midi module</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>Called automatically atexit if you don’t call it.</p> -<p>It is safe to call this function more than once.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.midi.time"> -<tt class="descclassname">pygame.midi.</tt><tt class="descname">time</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.midi.time" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the current time in ms of the PortMidi timer</span></div> -<div class="line"><span class="signature">time() -> time</span></div> -</div> -<p>The time is reset to 0, when the module is inited.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="mixer.html" title="pygame.mixer" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="math.html" title="pygame.math" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/mixer.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,845 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.mixer — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.mouse" href="mouse.html" /> - <link rel="prev" title="pygame.midi" href="midi.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.mixer"> -<span id="pygame-mixer"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.mixer</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for loading and playing sounds</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="32%" /> -<col width="1%" /> -<col width="67%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.init">pygame.mixer.init</a></td> -<td>—</td> -<td>initialize the mixer module</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.pre_init">pygame.mixer.pre_init</a></td> -<td>—</td> -<td>preset the mixer init arguments</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.quit">pygame.mixer.quit</a></td> -<td>—</td> -<td>uninitialize the mixer</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.get_init">pygame.mixer.get_init</a></td> -<td>—</td> -<td>test if the mixer is initialized</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.stop">pygame.mixer.stop</a></td> -<td>—</td> -<td>stop playback of all sound channels</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.pause">pygame.mixer.pause</a></td> -<td>—</td> -<td>temporarily stop playback of all sound channels</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.unpause">pygame.mixer.unpause</a></td> -<td>—</td> -<td>resume paused playback of sound channels</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.fadeout">pygame.mixer.fadeout</a></td> -<td>—</td> -<td>fade out the volume on all sounds before stopping</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.set_num_channels">pygame.mixer.set_num_channels</a></td> -<td>—</td> -<td>set the total number of playback channels</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.get_num_channels">pygame.mixer.get_num_channels</a></td> -<td>—</td> -<td>get the total number of playback channels</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.set_reserved">pygame.mixer.set_reserved</a></td> -<td>—</td> -<td>reserve channels from being automatically used</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.find_channel">pygame.mixer.find_channel</a></td> -<td>—</td> -<td>find an unused channel</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.get_busy">pygame.mixer.get_busy</a></td> -<td>—</td> -<td>test if any sound is being mixed</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound">pygame.mixer.Sound</a></td> -<td>—</td> -<td>Create a new Sound object from a file or buffer object</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel">pygame.mixer.Channel</a></td> -<td>—</td> -<td>Create a Channel object for controlling playback</td> -</tr> -</tbody> -</table> -<p>This module contains classes for loading Sound objects and controlling -playback. The mixer module is optional and depends on SDL_mixer. Your program -should test that <a class="tooltip reference internal" href="#module-pygame.mixer" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mixer</span></tt><span class="tooltip-content">pygame module for loading and playing sounds</span></a> is available and intialized before using -it.</p> -<p>The mixer module has a limited number of channels for playback of sounds. -Usually programs tell pygame to start playing audio and it selects an available -channel automatically. The default is 8 simultaneous channels, but complex -programs can get more precise control over the number of channels and their -use.</p> -<p>All sound playback is mixed in background threads. When you begin to play a -Sound object, it will return immediately while the sound continues to play. A -single Sound object can also be actively played back multiple times.</p> -<p>The mixer also has a special streaming channel. This is for music playback and -is accessed through the <a class="tooltip reference internal" href="music.html#module-pygame.mixer.music" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mixer.music</span></tt><span class="tooltip-content">pygame module for controlling streamed audio</span></a> module.</p> -<p>The mixer module must be initialized like other pygame modules, but it has some -extra conditions. The <tt class="docutils literal"><span class="pre">pygame.mixer.init()</span></tt> function takes several optional -arguments to control the playback rate and sample size. Pygame will default to -reasonable values, but pygame cannot perform Sound resampling, so the mixer -should be initialized to match the values of your audio resources.</p> -<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>: Not to get less laggy sound, use a smaller buffer size. The default -is set to reduce the chance of scratchy sounds on some computers. You can -change the default buffer by calling <a class="tooltip reference internal" href="#pygame.mixer.pre_init" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.mixer.pre_init()</span></tt><span class="tooltip-content">preset the mixer init arguments</span></a> before -<a class="tooltip reference internal" href="#pygame.mixer.init" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.mixer.init()</span></tt><span class="tooltip-content">initialize the mixer module</span></a> or <a class="tooltip reference internal" href="pygame.html#pygame.init" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.init()</span></tt><span class="tooltip-content">initialize all imported pygame modules</span></a> is called. For example: -<tt class="docutils literal"><span class="pre">pygame.mixer.pre_init(44100,-16,2,</span> <span class="pre">1024)</span></tt> The default size was changed from -1024 to 3072 in pygame 1.8.</p> -<dl class="definition function"> -<dt class="title" id="pygame.mixer.init"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize the mixer module</span></div> -<div class="line"><span class="signature">init(frequency=22050, size=-16, channels=2, buffer=4096) -> None</span></div> -</div> -<p>Initialize the mixer module for Sound loading and playback. The default -arguments can be overridden to provide specific audio mixing. Keyword -arguments are accepted. For backward compatibility where an argument is set -zero the default value is used (possible changed by a pre_init call).</p> -<p>The size argument represents how many bits are used for each audio sample. -If the value is negative then signed sample values will be used. Positive -values mean unsigned audio samples will be used. An invalid value raises an -exception.</p> -<p>The channels argument is used to specify whether to use mono or stereo. 1 -for mono and 2 for stereo. No other values are supported (negative values -are treated as 1, values greater than 2 as 2).</p> -<p>The buffer argument controls the number of internal samples used in the -sound mixer. The default value should work for most cases. It can be lowered -to reduce latency, but sound dropout may occur. It can be raised to larger -values to ensure playback never skips, but it will impose latency on sound -playback. The buffer size must be a power of two (if not it is rounded up to -the next nearest power of 2).</p> -<p>Some platforms require the <a class="tooltip reference internal" href="#module-pygame.mixer" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mixer</span></tt><span class="tooltip-content">pygame module for loading and playing sounds</span></a> module to be initialized -after the display modules have initialized. The top level <tt class="docutils literal"><span class="pre">pygame.init()</span></tt> -takes care of this automatically, but cannot pass any arguments to the mixer -init. To solve this, mixer has a function <tt class="docutils literal"><span class="pre">pygame.mixer.pre_init()</span></tt> to set -the proper defaults before the toplevel init is used.</p> -<p>It is safe to call this more than once, but after the mixer is initialized -you cannot change the playback arguments without first calling -<tt class="docutils literal"><span class="pre">pygame.mixer.quit()</span></tt>.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.pre_init"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">pre_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.pre_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">preset the mixer init arguments</span></div> -<div class="line"><span class="signature">pre_init(frequency=22050, size=-16, channels=2, buffersize=4096) -> None</span></div> -</div> -<p>Call pre_init to change the defaults used when the real -<tt class="docutils literal"><span class="pre">pygame.mixer.init()</span></tt> is called. Keyword arguments are accepted. The best -way to set custom mixer playback values is to call -<tt class="docutils literal"><span class="pre">pygame.mixer.pre_init()</span></tt> before calling the top level <tt class="docutils literal"><span class="pre">pygame.init()</span></tt>. -For backward compatibility argument values of zero is replaced with the -startup defaults.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.quit"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize the mixer</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>This will uninitialize <a class="tooltip reference internal" href="#module-pygame.mixer" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mixer</span></tt><span class="tooltip-content">pygame module for loading and playing sounds</span></a>. All playback will stop and any -loaded Sound objects may not be compatible with the mixer if it is -reinitialized later.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.get_init"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.get_init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if the mixer is initialized</span></div> -<div class="line"><span class="signature">get_init() -> (frequency, format, channels)</span></div> -</div> -<p>If the mixer is initialized, this returns the playback arguments it is -using. If the mixer has not been initialized this returns None</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.stop"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.stop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop playback of all sound channels</span></div> -<div class="line"><span class="signature">stop() -> None</span></div> -</div> -<p>This will stop all playback of all active mixer channels.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.pause"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">pause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.pause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">temporarily stop playback of all sound channels</span></div> -<div class="line"><span class="signature">pause() -> None</span></div> -</div> -<p>This will temporarily stop all playback on the active mixer channels. The -playback can later be resumed with <tt class="docutils literal"><span class="pre">pygame.mixer.unpause()</span></tt></p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.unpause"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">unpause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.unpause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">resume paused playback of sound channels</span></div> -<div class="line"><span class="signature">unpause() -> None</span></div> -</div> -<p>This will resume all active sound channels after they have been paused.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.fadeout"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">fadeout</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.fadeout" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">fade out the volume on all sounds before stopping</span></div> -<div class="line"><span class="signature">fadeout(time) -> None</span></div> -</div> -<p>This will fade out the volume on all active channels over the time argument -in milliseconds. After the sound is muted the playback will stop.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.set_num_channels"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">set_num_channels</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.set_num_channels" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the total number of playback channels</span></div> -<div class="line"><span class="signature">set_num_channels(count) -> None</span></div> -</div> -<p>Sets the number of available channels for the mixer. The default value is 8. -The value can be increased or decreased. If the value is decreased, sounds -playing on the truncated channels are stopped.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.get_num_channels"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">get_num_channels</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.get_num_channels" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the total number of playback channels</span></div> -<div class="line"><span class="signature">get_num_channels() -> count</span></div> -</div> -<p>Returns the number of currently active playback channels.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.set_reserved"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">set_reserved</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.set_reserved" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">reserve channels from being automatically used</span></div> -<div class="line"><span class="signature">set_reserved(count) -> None</span></div> -</div> -<p>The mixer can reserve any number of channels that will not be automatically -selected for playback by Sounds. If sounds are currently playing on the -reserved channels they will not be stopped.</p> -<p>This allows the application to reserve a specific number of channels for -important sounds that must not be dropped or have a guaranteed channel to -play on.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.find_channel"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">find_channel</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.find_channel" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find an unused channel</span></div> -<div class="line"><span class="signature">find_channel(force=False) -> Channel</span></div> -</div> -<p>This will find and return an inactive Channel object. If there are no -inactive Channels this function will return None. If there are no inactive -channels and the force argument is True, this will find the Channel with the -longest running Sound and return it.</p> -<p>If the mixer has reserved channels from <tt class="docutils literal"><span class="pre">pygame.mixer.set_reserved()</span></tt> then -those channels will not be returned here.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.get_busy"> -<tt class="descclassname">pygame.mixer.</tt><tt class="descname">get_busy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.get_busy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if any sound is being mixed</span></div> -<div class="line"><span class="signature">get_busy() -> bool</span></div> -</div> -<p>Returns True if the mixer is busy mixing any channels. If the mixer is idle -then this return False.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.mixer.Sound"> -<em class="property">class </em><tt class="descclassname">pygame.mixer.</tt><tt class="descname">Sound</tt><a class="headerlink" href="#pygame.mixer.Sound" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Create a new Sound object from a file or buffer object</span></div> -<div class="line"><span class="signature">Sound(filename) -> Sound</span></div> -<div class="line"><span class="signature">Sound(file=filename) -> Sound</span></div> -<div class="line"><span class="signature">Sound(buffer) -> Sound</span></div> -<div class="line"><span class="signature">Sound(buffer=buffer) -> Sound</span></div> -<div class="line"><span class="signature">Sound(object) -> Sound</span></div> -<div class="line"><span class="signature">Sound(file=object) -> Sound</span></div> -<div class="line"><span class="signature">Sound(array=object) -> Sound</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="36%" /> -<col width="1%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.play">pygame.mixer.Sound.play</a></td> -<td>—</td> -<td>begin sound playback</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.stop">pygame.mixer.Sound.stop</a></td> -<td>—</td> -<td>stop sound playback</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.fadeout">pygame.mixer.Sound.fadeout</a></td> -<td>—</td> -<td>stop sound playback after fading out</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.set_volume">pygame.mixer.Sound.set_volume</a></td> -<td>—</td> -<td>set the playback volume for this Sound</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.get_volume">pygame.mixer.Sound.get_volume</a></td> -<td>—</td> -<td>get the playback volume</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.get_num_channels">pygame.mixer.Sound.get_num_channels</a></td> -<td>—</td> -<td>count how many times this Sound is playing</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.get_length">pygame.mixer.Sound.get_length</a></td> -<td>—</td> -<td>get the length of the Sound</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Sound.get_buffer">pygame.mixer.Sound.get_buffer</a></td> -<td>—</td> -<td>acquires a buffer object for the samples of the Sound.</td> -</tr> -</tbody> -</table> -<p>Load a new sound buffer from a filename, a python file object or a readable -buffer object. Limited resampling will be performed to help the sample match -the initialize arguments for the mixer. A Unicode string can only be a file -pathname. A Python 2.x string or a Python 3.x bytes object can be either a -pathname or a buffer object. Use the ‘file’ or ‘buffer’ keywords to avoid -ambiguity; otherwise Sound may guess wrong. If the array keyword is used, -the object is expected to export a version 3, <tt class="docutils literal"><span class="pre">C</span></tt> level array interface -or, for Python 2.6 or later, a new buffer interface (The object is checked -for a buffer interface first.)</p> -<p>The Sound object represents actual sound sample data. Methods that change -the state of the Sound object will the all instances of the Sound playback. -A Sound object also exports an array interface, and, for Python 2.6 or -later, a new buffer interface.</p> -<p>The Sound can be loaded from an <tt class="docutils literal"><span class="pre">OGG</span></tt> audio file or from an uncompressed -<tt class="docutils literal"><span class="pre">WAV</span></tt>.</p> -<p>Note: The buffer will be copied internally, no data will be shared between -it and the Sound object.</p> -<p>For now buffer and array support is consistent with <tt class="docutils literal"><span class="pre">sndarray.make_sound</span></tt> -for Numeric arrays, in that sample sign and byte order are ignored. This -will change, either by correctly handling sign and byte order, or by raising -an exception when different. Also, source samples are truncated to fit the -audio sample size. This will not change.</p> -<p><tt class="docutils literal"><span class="pre">pygame.mixer.Sound(buffer)</span></tt> is new in pygame 1.8 -<a class="tooltip reference internal" href="#pygame.mixer.Sound" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.mixer.Sound</span></tt><span class="tooltip-content">Create a new Sound object from a file or buffer object</span></a> keyword arguments and array interface support -new in pygame 1.9.2</p> -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.play"> -<tt class="descname">play</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.play" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">begin sound playback</span></div> -<div class="line"><span class="signature">play(loops=0, maxtime=0, fade_ms=0) -> Channel</span></div> -</div> -<p>Begin playback of the Sound (i.e., on the computer’s speakers) on an -available Channel. This will forcibly select a Channel, so playback may -cut off a currently playing sound if necessary.</p> -<p>The loops argument controls how many times the sample will be repeated -after being played the first time. A value of 5 means that the sound will -be played once, then repeated five times, and so is played a total of six -times. The default value (zero) means the Sound is not repeated, and so -is only played once. If loops is set to -1 the Sound will loop -indefinitely (though you can still call <tt class="docutils literal"><span class="pre">stop()</span></tt> to stop it).</p> -<p>The maxtime argument can be used to stop playback after a given number of -milliseconds.</p> -<p>The fade_ms argument will make the sound start playing at 0 volume and -fade up to full volume over the time given. The sample may end before the -fade-in is complete.</p> -<p>This returns the Channel object for the channel that was selected.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.stop"> -<tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.stop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop sound playback</span></div> -<div class="line"><span class="signature">stop() -> None</span></div> -</div> -<p>This will stop the playback of this Sound on any active Channels.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.fadeout"> -<tt class="descname">fadeout</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.fadeout" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop sound playback after fading out</span></div> -<div class="line"><span class="signature">fadeout(time) -> None</span></div> -</div> -<p>This will stop playback of the sound after fading it out over the time -argument in milliseconds. The Sound will fade and stop on all actively -playing channels.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.set_volume"> -<tt class="descname">set_volume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.set_volume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the playback volume for this Sound</span></div> -<div class="line"><span class="signature">set_volume(value) -> None</span></div> -</div> -<p>This will set the playback volume (loudness) for this Sound. This will -immediately affect the Sound if it is playing. It will also affect any -future playback of this Sound. The argument is a value from 0.0 to 1.0.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.get_volume"> -<tt class="descname">get_volume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.get_volume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the playback volume</span></div> -<div class="line"><span class="signature">get_volume() -> value</span></div> -</div> -<p>Return a value from 0.0 to 1.0 representing the volume for this Sound.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.get_num_channels"> -<tt class="descname">get_num_channels</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.get_num_channels" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">count how many times this Sound is playing</span></div> -<div class="line"><span class="signature">get_num_channels() -> count</span></div> -</div> -<p>Return the number of active channels this sound is playing on.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.get_length"> -<tt class="descname">get_length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.get_length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the length of the Sound</span></div> -<div class="line"><span class="signature">get_length() -> seconds</span></div> -</div> -<p>Return the length of this Sound in seconds.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Sound.get_buffer"> -<tt class="descname">get_buffer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Sound.get_buffer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">acquires a buffer object for the samples of the Sound.</span></div> -<div class="line"><span class="signature">get_buffer() -> BufferProxy</span></div> -</div> -<p>Return a buffer object for the Sound samples. The buffer can be used for -direct access and manipulation.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.mixer.Channel"> -<em class="property">class </em><tt class="descclassname">pygame.mixer.</tt><tt class="descname">Channel</tt><a class="headerlink" href="#pygame.mixer.Channel" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Create a Channel object for controlling playback</span></div> -<div class="line"><span class="signature">Channel(id) -> Channel</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="36%" /> -<col width="1%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.play">pygame.mixer.Channel.play</a></td> -<td>—</td> -<td>play a Sound on a specific Channel</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.stop">pygame.mixer.Channel.stop</a></td> -<td>—</td> -<td>stop playback on a Channel</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.pause">pygame.mixer.Channel.pause</a></td> -<td>—</td> -<td>temporarily stop playback of a channel</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.unpause">pygame.mixer.Channel.unpause</a></td> -<td>—</td> -<td>resume pause playback of a channel</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.fadeout">pygame.mixer.Channel.fadeout</a></td> -<td>—</td> -<td>stop playback after fading channel out</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.set_volume">pygame.mixer.Channel.set_volume</a></td> -<td>—</td> -<td>set the volume of a playing channel</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.get_volume">pygame.mixer.Channel.get_volume</a></td> -<td>—</td> -<td>get the volume of the playing channel</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.get_busy">pygame.mixer.Channel.get_busy</a></td> -<td>—</td> -<td>check if the channel is active</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.get_sound">pygame.mixer.Channel.get_sound</a></td> -<td>—</td> -<td>get the currently playing Sound</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.queue">pygame.mixer.Channel.queue</a></td> -<td>—</td> -<td>queue a Sound object to follow the current</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.get_queue">pygame.mixer.Channel.get_queue</a></td> -<td>—</td> -<td>return any Sound that is queued</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.set_endevent">pygame.mixer.Channel.set_endevent</a></td> -<td>—</td> -<td>have the channel send an event when playback stops</td> -</tr> -<tr><td><a class="toc reference external" href="mixer.html#pygame.mixer.Channel.get_endevent">pygame.mixer.Channel.get_endevent</a></td> -<td>—</td> -<td>get the event a channel sends when playback stops</td> -</tr> -</tbody> -</table> -<p>Return a Channel object for one of the current channels. The id must be a -value from 0 to the value of <tt class="docutils literal"><span class="pre">pygame.mixer.get_num_channels()</span></tt>.</p> -<p>The Channel object can be used to get fine control over the playback of -Sounds. A channel can only playback a single Sound at time. Using channels -is entirely optional since pygame can manage them by default.</p> -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.play"> -<tt class="descname">play</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.play" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">play a Sound on a specific Channel</span></div> -<div class="line"><span class="signature">play(Sound, loops=0, maxtime=0, fade_ms=0) -> None</span></div> -</div> -<p>This will begin playback of a Sound on a specific Channel. If the Channel -is currently playing any other Sound it will be stopped.</p> -<p>The loops argument has the same meaning as in <tt class="docutils literal"><span class="pre">Sound.play()</span></tt>: it is the -number of times to repeat the sound after the first time. If it is 3, the -sound will be played 4 times (the first time, then three more). If loops -is -1 then the playback will repeat indefinitely.</p> -<p>As in <tt class="docutils literal"><span class="pre">Sound.play()</span></tt>, the maxtime argument can be used to stop playback -of the Sound after a given number of milliseconds.</p> -<p>As in <tt class="docutils literal"><span class="pre">Sound.play()</span></tt>, the fade_ms argument can be used fade in the -sound.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.stop"> -<tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.stop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop playback on a Channel</span></div> -<div class="line"><span class="signature">stop() -> None</span></div> -</div> -<p>Stop sound playback on a channel. After playback is stopped the channel -becomes available for new Sounds to play on it.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.pause"> -<tt class="descname">pause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.pause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">temporarily stop playback of a channel</span></div> -<div class="line"><span class="signature">pause() -> None</span></div> -</div> -<p>Temporarily stop the playback of sound on a channel. It can be resumed at -a later time with <tt class="docutils literal"><span class="pre">Channel.unpause()</span></tt></p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.unpause"> -<tt class="descname">unpause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.unpause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">resume pause playback of a channel</span></div> -<div class="line"><span class="signature">unpause() -> None</span></div> -</div> -<p>Resume the playback on a paused channel.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.fadeout"> -<tt class="descname">fadeout</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.fadeout" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop playback after fading channel out</span></div> -<div class="line"><span class="signature">fadeout(time) -> None</span></div> -</div> -<p>Stop playback of a channel after fading out the sound over the given time -argument in milliseconds.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.set_volume"> -<tt class="descname">set_volume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.set_volume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the volume of a playing channel</span></div> -<div class="line"><span class="signature">set_volume(value) -> None</span></div> -<div class="line"><span class="signature">set_volume(left, right) -> None</span></div> -</div> -<p>Set the volume (loudness) of a playing sound. When a channel starts to -play its volume value is reset. This only affects the current sound. The -value argument is between 0.0 and 1.0.</p> -<p>If one argument is passed, it will be the volume of both speakers. If two -arguments are passed and the mixer is in stereo mode, the first argument -will be the volume of the left speaker and the second will be the volume -of the right speaker. (If the second argument is None, the first argument -will be the volume of both speakers.)</p> -<p>If the channel is playing a Sound on which <tt class="docutils literal"><span class="pre">set_volume()</span></tt> has also been -called, both calls are taken into account. For example:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">sound</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">mixer</span><span class="o">.</span><span class="n">Sound</span><span class="p">(</span><span class="s">"s.wav"</span><span class="p">)</span> -<span class="n">channel</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">play</span><span class="p">()</span> <span class="c"># Sound plays at full volume by default</span> -<span class="n">sound</span><span class="o">.</span><span class="n">set_volume</span><span class="p">(</span><span class="mf">0.9</span><span class="p">)</span> <span class="c"># Now plays at 90% of full volume.</span> -<span class="n">sound</span><span class="o">.</span><span class="n">set_volume</span><span class="p">(</span><span class="mf">0.6</span><span class="p">)</span> <span class="c"># Now plays at 60% (previous value replaced).</span> -<span class="n">channel</span><span class="o">.</span><span class="n">set_volume</span><span class="p">(</span><span class="mf">0.5</span><span class="p">)</span> <span class="c"># Now plays at 30% (0.6 * 0.5).</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.get_volume"> -<tt class="descname">get_volume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.get_volume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the volume of the playing channel</span></div> -<div class="line"><span class="signature">get_volume() -> value</span></div> -</div> -<p>Return the volume of the channel for the current playing sound. This does -not take into account stereo separation used by -<a class="reference internal" href="#pygame.mixer.Channel.set_volume" title="pygame.mixer.Channel.set_volume"><tt class="xref py py-meth docutils literal"><span class="pre">Channel.set_volume()</span></tt></a>. The Sound object also has its own volume -which is mixed with the channel.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.get_busy"> -<tt class="descname">get_busy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.get_busy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the channel is active</span></div> -<div class="line"><span class="signature">get_busy() -> bool</span></div> -</div> -<p>Returns true if the channel is activily mixing sound. If the channel is -idle this returns False.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.get_sound"> -<tt class="descname">get_sound</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.get_sound" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the currently playing Sound</span></div> -<div class="line"><span class="signature">get_sound() -> Sound</span></div> -</div> -<p>Return the actual Sound object currently playing on this channel. If the -channel is idle None is returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.queue"> -<tt class="descname">queue</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.queue" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">queue a Sound object to follow the current</span></div> -<div class="line"><span class="signature">queue(Sound) -> None</span></div> -</div> -<p>When a Sound is queued on a Channel, it will begin playing immediately -after the current Sound is finished. Each channel can only have a single -Sound queued at a time. The queued Sound will only play if the current -playback finished automatically. It is cleared on any other call to -<tt class="docutils literal"><span class="pre">Channel.stop()</span></tt> or <tt class="docutils literal"><span class="pre">Channel.play()</span></tt>.</p> -<p>If there is no sound actively playing on the Channel then the Sound will -begin playing immediately.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.get_queue"> -<tt class="descname">get_queue</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.get_queue" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">return any Sound that is queued</span></div> -<div class="line"><span class="signature">get_queue() -> Sound</span></div> -</div> -<p>If a Sound is already queued on this channel it will be returned. Once -the queued sound begins playback it will no longer be on the queue.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.set_endevent"> -<tt class="descname">set_endevent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.set_endevent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">have the channel send an event when playback stops</span></div> -<div class="line"><span class="signature">set_endevent() -> None</span></div> -<div class="line"><span class="signature">set_endevent(type) -> None</span></div> -</div> -<p>When an endevent is set for a channel, it will send an event to the -pygame queue every time a sound finishes playing on that channel (not -just the first time). Use <tt class="docutils literal"><span class="pre">pygame.event.get()</span></tt> to retrieve the endevent -once it’s sent.</p> -<p>Note that if you called <tt class="docutils literal"><span class="pre">Sound.play(n)</span></tt> or <tt class="docutils literal"><span class="pre">Channel.play(sound,n)</span></tt>, -the end event is sent only once: after the sound has been played “n+1” -times (see the documentation of Sound.play).</p> -<p>If <tt class="docutils literal"><span class="pre">Channel.stop()</span></tt> or <tt class="docutils literal"><span class="pre">Channel.play()</span></tt> is called while the sound was -still playing, the event will be posted immediately.</p> -<p>The type argument will be the event id sent to the queue. This can be any -valid event type, but a good choice would be a value between -<tt class="docutils literal"><span class="pre">pygame.locals.USEREVENT</span></tt> and <tt class="docutils literal"><span class="pre">pygame.locals.NUMEVENTS</span></tt>. If no type -argument is given then the Channel will stop sending endevents.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.mixer.Channel.get_endevent"> -<tt class="descname">get_endevent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.Channel.get_endevent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the event a channel sends when playback stops</span></div> -<div class="line"><span class="signature">get_endevent() -> type</span></div> -</div> -<p>Returns the event type to be sent every time the Channel finishes -playback of a Sound. If there is no endevent the function returns -<tt class="docutils literal"><span class="pre">pygame.NOEVENT</span></tt>.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="mouse.html" title="pygame.mouse" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="midi.html" title="pygame.midi" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/mouse.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,309 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.mouse — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.movie" href="movie.html" /> - <link rel="prev" title="pygame.mixer" href="mixer.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.mouse"> -<span id="pygame-mouse"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.mouse</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module to work with the mouse</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="32%" /> -<col width="1%" /> -<col width="67%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.get_pressed">pygame.mouse.get_pressed</a></td> -<td>—</td> -<td>get the state of the mouse buttons</td> -</tr> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.get_pos">pygame.mouse.get_pos</a></td> -<td>—</td> -<td>get the mouse cursor position</td> -</tr> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.get_rel">pygame.mouse.get_rel</a></td> -<td>—</td> -<td>get the amount of mouse movement</td> -</tr> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.set_pos">pygame.mouse.set_pos</a></td> -<td>—</td> -<td>set the mouse cursor position</td> -</tr> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.set_visible">pygame.mouse.set_visible</a></td> -<td>—</td> -<td>hide or show the mouse cursor</td> -</tr> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.get_focused">pygame.mouse.get_focused</a></td> -<td>—</td> -<td>check if the display is receiving mouse input</td> -</tr> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.set_cursor">pygame.mouse.set_cursor</a></td> -<td>—</td> -<td>set the image for the system mouse cursor</td> -</tr> -<tr><td><a class="toc reference external" href="mouse.html#pygame.mouse.get_cursor">pygame.mouse.get_cursor</a></td> -<td>—</td> -<td>get the image for the system mouse cursor</td> -</tr> -</tbody> -</table> -<p>The mouse functions can be used to get the current state of the mouse device. -These functions can also alter the system cursor for the mouse.</p> -<p>When the display mode is set, the event queue will start receiving mouse -events. The mouse buttons generate <tt class="docutils literal"><span class="pre">pygame.MOUSEBUTTONDOWN</span></tt> and -<tt class="docutils literal"><span class="pre">pygame.MOUSEBUTTONUP</span></tt> events when they are pressed and released. These -events contain a button attribute representing which button was pressed. The -mouse wheel will generate <tt class="docutils literal"><span class="pre">pygame.MOUSEBUTTONDOWN</span></tt> and -<tt class="docutils literal"><span class="pre">pygame.MOUSEBUTTONUP</span></tt> events when rolled. The button will be set to 4 -when the wheel is rolled up, and to button 5 when the wheel is rolled down. -Anytime the mouse is moved it generates a <tt class="docutils literal"><span class="pre">pygame.MOUSEMOTION</span></tt> event. The -mouse movement is broken into small and accurate motion events. As the mouse -is moving many motion events will be placed on the queue. Mouse motion events -that are not properly cleaned from the event queue are the primary reason the -event queue fills up.</p> -<p>If the mouse cursor is hidden, and input is grabbed to the current display the -mouse will enter a virtual input mode, where the relative movements of the -mouse will never be stopped by the borders of the screen. See the functions -<tt class="docutils literal"><span class="pre">pygame.mouse.set_visible()</span></tt> and <tt class="docutils literal"><span class="pre">pygame.event.set_grab()</span></tt> to get this -configured.</p> -<dl class="definition function"> -<dt class="title" id="pygame.mouse.get_pressed"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">get_pressed</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.get_pressed" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the state of the mouse buttons</span></div> -<div class="line"><span class="signature">get_pressed() -> (button1, button2, button3)</span></div> -</div> -<p>Returns a sequence of booleans representing the state of all the mouse -buttons. A true value means the mouse is currently being pressed at the time -of the call.</p> -<p>Note, to get all of the mouse events it is better to use either</p> -<div class="highlight-python"><pre>pygame.event.wait() or pygame.event.get() and check all of those events</pre> -</div> -<p>to see if they are <tt class="docutils literal"><span class="pre">MOUSEBUTTONDOWN</span></tt>, <tt class="docutils literal"><span class="pre">MOUSEBUTTONUP</span></tt>, or -<tt class="docutils literal"><span class="pre">MOUSEMOTION</span></tt>.</p> -<p>Note, that on <tt class="docutils literal"><span class="pre">X11</span></tt> some XServers use middle button emulation. When you -click both buttons 1 and 3 at the same time a 2 button event can be emitted.</p> -<p>Note, remember to call <tt class="docutils literal"><span class="pre">pygame.event.get()</span></tt> before this function. -Otherwise it will not work.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mouse.get_pos"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">get_pos</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.get_pos" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the mouse cursor position</span></div> -<div class="line"><span class="signature">get_pos() -> (x, y)</span></div> -</div> -<p>Returns the <tt class="docutils literal"><span class="pre">X</span></tt> and <tt class="docutils literal"><span class="pre">Y</span></tt> position of the mouse cursor. The position is -relative the the top-left corner of the display. The cursor position can be -located outside of the display window, but is always constrained to the -screen.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mouse.get_rel"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">get_rel</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.get_rel" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the amount of mouse movement</span></div> -<div class="line"><span class="signature">get_rel() -> (x, y)</span></div> -</div> -<p>Returns the amount of movement in <tt class="docutils literal"><span class="pre">X</span></tt> and <tt class="docutils literal"><span class="pre">Y</span></tt> since the previous call to -this function. The relative movement of the mouse cursor is constrained to -the edges of the screen, but see the virtual input mouse mode for a way -around this. Virtual input mode is described at the top of the page.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mouse.set_pos"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">set_pos</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.set_pos" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the mouse cursor position</span></div> -<div class="line"><span class="signature">set_pos([x, y]) -> None</span></div> -</div> -<p>Set the current mouse position to arguments given. If the mouse cursor is -visible it will jump to the new coordinates. Moving the mouse will generate -a new <tt class="docutils literal"><span class="pre">pygame.MOUSEMOTION</span></tt> event.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mouse.set_visible"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">set_visible</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.set_visible" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">hide or show the mouse cursor</span></div> -<div class="line"><span class="signature">set_visible(bool) -> bool</span></div> -</div> -<p>If the bool argument is true, the mouse cursor will be visible. This will -return the previous visible state of the cursor.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mouse.get_focused"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">get_focused</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.get_focused" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the display is receiving mouse input</span></div> -<div class="line"><span class="signature">get_focused() -> bool</span></div> -</div> -<p>Returns true when pygame is receiving mouse input events (or, in windowing -terminology, is “active” or has the “focus”).</p> -<p>This method is most useful when working in a window. By contrast, in -full-screen mode, this method always returns true.</p> -<p>Note: under <tt class="docutils literal"><span class="pre">MS</span></tt> Windows, the window that has the mouse focus also has the -keyboard focus. But under X-Windows, one window can receive mouse events and -another receive keyboard events. <tt class="docutils literal"><span class="pre">pygame.mouse.get_focused()</span></tt> indicates -whether the pygame window receives mouse events.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mouse.set_cursor"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">set_cursor</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.set_cursor" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the image for the system mouse cursor</span></div> -<div class="line"><span class="signature">set_cursor(size, hotspot, xormasks, andmasks) -> None</span></div> -</div> -<p>When the mouse cursor is visible, it will be displayed as a black and white -bitmap using the given bitmask arrays. The size is a sequence containing the -cursor width and height. Hotspot is a sequence containing the cursor hotspot -position. xormasks is a sequence of bytes containing the cursor xor data -masks. Lastly is andmasks, a sequence of bytes containting the cursor -bitmask data.</p> -<p>Width must be a multiple of 8, and the mask arrays must be the correct size -for the given width and height. Otherwise an exception is raised.</p> -<p>See the <tt class="docutils literal"><span class="pre">pygame.cursor</span></tt> module for help creating default and custom masks -for the system cursor.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mouse.get_cursor"> -<tt class="descclassname">pygame.mouse.</tt><tt class="descname">get_cursor</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mouse.get_cursor" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the image for the system mouse cursor</span></div> -<div class="line"><span class="signature">get_cursor() -> (size, hotspot, xormasks, andmasks)</span></div> -</div> -<p>Get the information about the mouse system cursor. The return value is the -same data as the arguments passed into <tt class="docutils literal"><span class="pre">pygame.mouse.set_cursor()</span></tt>.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="movie.html" title="pygame.movie" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="mixer.html" title="pygame.mixer" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/movie.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,420 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.movie — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.mixer.music" href="music.html" /> - <link rel="prev" title="pygame.mouse" href="mouse.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.movie"> -<span id="pygame-movie"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.movie</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for playback of mpeg video</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="37%" /> -<col width="2%" /> -<col width="61%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie">pygame.movie.Movie</a></td> -<td>—</td> -<td>load an mpeg movie file</td> -</tr> -</tbody> -</table> -<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>: On <tt class="docutils literal"><span class="pre">NT</span></tt> derived Windows versions (e.g. <tt class="docutils literal"><span class="pre">XT</span></tt>) the default <tt class="docutils literal"><span class="pre">SDL</span></tt> -directx video driver is problematic. For <a class="tooltip reference internal" href="#module-pygame.movie" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.movie</span></tt><span class="tooltip-content">pygame module for playback of mpeg video</span></a>, use the windib -driver instead. To enable windib set the <tt class="docutils literal"><span class="pre">SDL_VIDEODRIVER</span></tt> environment -variable to ‘windib’ before importing pygame (see the -<a class="tooltip reference internal" href="examples.html#pygame.examples.movieplayer.main" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.examples.movieplayer.main()</span></tt><span class="tooltip-content">play an MPEG movie</span></a> example).</p> -<p>Pygame can playback video and audio from basic encoded MPEG-1 video files. -Movie playback happens in background threads, which makes playback easy to -manage.</p> -<p>The audio for Movies must have full control over the sound system. This means -the <a class="tooltip reference internal" href="mixer.html#module-pygame.mixer" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mixer</span></tt><span class="tooltip-content">pygame module for loading and playing sounds</span></a> module must be uninitialized if the movie’s sound is to -be played. The common solution is to call <tt class="docutils literal"><span class="pre">pygame.mixer.quit()</span></tt> before the -movie begins. The mixer can be reinitialized after the movie is finished.</p> -<p>The video overlay planes are drawn on top of everything in the display window. -To draw the movie as normal graphics into the display window, create an -offscreen Surface and set that as the movie target. Then once per frame blit -that surface to the screen.</p> -<p>Videos can be converted to the .mpg file format (MPEG-1 video, MPEG-1 Audio -Layer <tt class="docutils literal"><span class="pre">III</span></tt> (MP3) sound) using ffmpeg video conversion program -(<a class="reference external" href="http://ffmpeg.org/">http://ffmpeg.org/</a>):</p> -<div class="highlight-python"><pre>ffmpeg -i <infile> -vcodec mpeg1video -acodec libmp3lame -intra <outfile.mpg></pre> -</div> -<dl class="definition class"> -<dt class="title" id="pygame.movie.Movie"> -<em class="property">class </em><tt class="descclassname">pygame.movie.</tt><tt class="descname">Movie</tt><a class="headerlink" href="#pygame.movie.Movie" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">load an mpeg movie file</span></div> -<div class="line"><span class="signature">Movie(filename) -> Movie</span></div> -<div class="line"><span class="signature">Movie(object) -> Movie</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="39%" /> -<col width="1%" /> -<col width="60%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.play">pygame.movie.Movie.play</a></td> -<td>—</td> -<td>start playback of a movie</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.stop">pygame.movie.Movie.stop</a></td> -<td>—</td> -<td>stop movie playback</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.pause">pygame.movie.Movie.pause</a></td> -<td>—</td> -<td>temporarily stop and resume playback</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.skip">pygame.movie.Movie.skip</a></td> -<td>—</td> -<td>advance the movie playback position</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.rewind">pygame.movie.Movie.rewind</a></td> -<td>—</td> -<td>restart the movie playback</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.render_frame">pygame.movie.Movie.render_frame</a></td> -<td>—</td> -<td>set the current video frame</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.get_frame">pygame.movie.Movie.get_frame</a></td> -<td>—</td> -<td>get the current video frame</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.get_time">pygame.movie.Movie.get_time</a></td> -<td>—</td> -<td>get the current vide playback time</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.get_busy">pygame.movie.Movie.get_busy</a></td> -<td>—</td> -<td>check if the movie is currently playing</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.get_length">pygame.movie.Movie.get_length</a></td> -<td>—</td> -<td>the total length of the movie in seconds</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.get_size">pygame.movie.Movie.get_size</a></td> -<td>—</td> -<td>get the resolution of the video</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.has_video">pygame.movie.Movie.has_video</a></td> -<td>—</td> -<td>check if the movie file contains video</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.has_audio">pygame.movie.Movie.has_audio</a></td> -<td>—</td> -<td>check if the movie file contains audio</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.set_volume">pygame.movie.Movie.set_volume</a></td> -<td>—</td> -<td>set the audio playback volume</td> -</tr> -<tr><td><a class="toc reference external" href="movie.html#pygame.movie.Movie.set_display">pygame.movie.Movie.set_display</a></td> -<td>—</td> -<td>set the video target Surface</td> -</tr> -</tbody> -</table> -<p>Load a new <tt class="docutils literal"><span class="pre">MPEG</span></tt> movie stream from a file or a python file object. The -Movie object operates similar to the Sound objects from <a class="tooltip reference internal" href="mixer.html#module-pygame.mixer" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mixer</span></tt><span class="tooltip-content">pygame module for loading and playing sounds</span></a>.</p> -<p>Movie objects have a target display Surface. The movie is rendered into this -Surface in a background thread. If the target Surface is the display -Surface, the movie will try to use the hardware accelerated video overlay. -The default target is the display Surface.</p> -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.play"> -<tt class="descname">play</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.play" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">start playback of a movie</span></div> -<div class="line"><span class="signature">play(loops=0) -> None</span></div> -</div> -<p>Starts playback of the movie. Sound and video will begin playing if they -are not disabled. The optional loops argument controls how many times the -movie will be repeated. A loop value of -1 means the movie will repeat -forever.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.stop"> -<tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.stop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop movie playback</span></div> -<div class="line"><span class="signature">stop() -> None</span></div> -</div> -<p>Stops the playback of a movie. The video and audio playback will be -stopped at their current position.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.pause"> -<tt class="descname">pause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.pause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">temporarily stop and resume playback</span></div> -<div class="line"><span class="signature">pause() -> None</span></div> -</div> -<p>This will temporarily stop or restart movie playback.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.skip"> -<tt class="descname">skip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.skip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">advance the movie playback position</span></div> -<div class="line"><span class="signature">skip(seconds) -> None</span></div> -</div> -<p>Advance the movie playback time in seconds. This can be called before the -movie is played to set the starting playback time. This can only skip the -movie forward, not backwards. The argument is a floating point number.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.rewind"> -<tt class="descname">rewind</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.rewind" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">restart the movie playback</span></div> -<div class="line"><span class="signature">rewind() -> None</span></div> -</div> -<p>Sets the movie playback position to the start of the movie. The movie -will automatically begin playing even if it stopped.</p> -<p>The can raise a ValueError if the movie cannot be rewound. If the rewind -fails the movie object is considered invalid.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.render_frame"> -<tt class="descname">render_frame</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.render_frame" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the current video frame</span></div> -<div class="line"><span class="signature">render_frame(frame_number) -> frame_number</span></div> -</div> -<p>This takes an integer frame number to render. It attempts to render the -given frame from the movie to the target Surface. It returns the real -frame number that got rendered.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.get_frame"> -<tt class="descname">get_frame</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.get_frame" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current video frame</span></div> -<div class="line"><span class="signature">get_frame() -> frame_number</span></div> -</div> -<p>Returns the integer frame number of the current video frame.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.get_time"> -<tt class="descname">get_time</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.get_time" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current vide playback time</span></div> -<div class="line"><span class="signature">get_time() -> seconds</span></div> -</div> -<p>Return the current playback time as a floating point value in seconds. -This method currently seems broken and always returns 0.0.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.get_busy"> -<tt class="descname">get_busy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.get_busy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the movie is currently playing</span></div> -<div class="line"><span class="signature">get_busy() -> bool</span></div> -</div> -<p>Returns true if the movie is currently being played.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.get_length"> -<tt class="descname">get_length</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.get_length" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the total length of the movie in seconds</span></div> -<div class="line"><span class="signature">get_length() -> seconds</span></div> -</div> -<p>Returns the length of the movie in seconds as a floating point value.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.get_size"> -<tt class="descname">get_size</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.get_size" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the resolution of the video</span></div> -<div class="line"><span class="signature">get_size() -> (width, height)</span></div> -</div> -<p>Gets the resolution of the movie video. The movie will be stretched to -the size of any Surface, but this will report the natural video size.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.has_video"> -<tt class="descname">has_video</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.has_video" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the movie file contains video</span></div> -<div class="line"><span class="signature">has_video() -> bool</span></div> -</div> -<p>True when the opened movie file contains a video stream.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.has_audio"> -<tt class="descname">has_audio</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.has_audio" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the movie file contains audio</span></div> -<div class="line"><span class="signature">has_audio() -> bool</span></div> -</div> -<p>True when the opened movie file contains an audio stream.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.set_volume"> -<tt class="descname">set_volume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.set_volume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the audio playback volume</span></div> -<div class="line"><span class="signature">set_volume(value) -> None</span></div> -</div> -<p>Set the playback volume for this movie. The argument is a value between -0.0 and 1.0. If the volume is set to 0 the movie audio will not be -decoded.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.movie.Movie.set_display"> -<tt class="descname">set_display</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.movie.Movie.set_display" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the video target Surface</span></div> -<div class="line"><span class="signature">set_display(Surface, rect=None) -> None</span></div> -</div> -<p>Set the output target Surface for the movie video. You may also pass a -rectangle argument for the position, which will move and stretch the -video into the given area.</p> -<p>If None is passed as the target Surface, the video decoding will be -disabled.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="music.html" title="pygame.mixer.music" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="mouse.html" title="pygame.mouse" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/music.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,398 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.mixer.music — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.Overlay" href="overlay.html" /> - <link rel="prev" title="pygame.movie" href="movie.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.mixer.music"> -<span id="pygame-mixer-music"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.mixer.music</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for controlling streamed audio</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="35%" /> -<col width="1%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.load">pygame.mixer.music.load</a></td> -<td>—</td> -<td>Load a music file for playback</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.play">pygame.mixer.music.play</a></td> -<td>—</td> -<td>Start the playback of the music stream</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.rewind">pygame.mixer.music.rewind</a></td> -<td>—</td> -<td>restart music</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.stop">pygame.mixer.music.stop</a></td> -<td>—</td> -<td>stop the music playback</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.pause">pygame.mixer.music.pause</a></td> -<td>—</td> -<td>temporarily stop music playback</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.unpause">pygame.mixer.music.unpause</a></td> -<td>—</td> -<td>resume paused music</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.fadeout">pygame.mixer.music.fadeout</a></td> -<td>—</td> -<td>stop music playback after fading out</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.set_volume">pygame.mixer.music.set_volume</a></td> -<td>—</td> -<td>set the music volume</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.get_volume">pygame.mixer.music.get_volume</a></td> -<td>—</td> -<td>get the music volume</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.get_busy">pygame.mixer.music.get_busy</a></td> -<td>—</td> -<td>check if the music stream is playing</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.set_pos">pygame.mixer.music.set_pos</a></td> -<td>—</td> -<td>set position to play from</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.get_pos">pygame.mixer.music.get_pos</a></td> -<td>—</td> -<td>get the music play time</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.queue">pygame.mixer.music.queue</a></td> -<td>—</td> -<td>queue a music file to follow the current</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.set_endevent">pygame.mixer.music.set_endevent</a></td> -<td>—</td> -<td>have the music send an event when playback stops</td> -</tr> -<tr><td><a class="toc reference external" href="music.html#pygame.mixer.music.get_endevent">pygame.mixer.music.get_endevent</a></td> -<td>—</td> -<td>get the event a channel sends when playback stops</td> -</tr> -</tbody> -</table> -<p>The music module is closely tied to <a class="tooltip reference internal" href="mixer.html#module-pygame.mixer" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.mixer</span></tt><span class="tooltip-content">pygame module for loading and playing sounds</span></a>. Use the music module -to control the playback of music in the sound mixer.</p> -<p>The difference between the music playback and regular Sound playback is that -the music is streamed, and never actually loaded all at once. The mixer system -only supports a single music stream at once.</p> -<p>Be aware that <tt class="docutils literal"><span class="pre">MP3</span></tt> support is limited. On some systems an unsupported format -can crash the program, <tt class="docutils literal"><span class="pre">e.g</span></tt>. Debian Linux. Consider using <tt class="docutils literal"><span class="pre">OGG</span></tt> instead.</p> -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.load"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">load</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.load" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Load a music file for playback</span></div> -<div class="line"><span class="signature">load(filename) -> None</span></div> -<div class="line"><span class="signature">load(object) -> None</span></div> -</div> -<p>This will load a music filename/file object and prepare it for playback. If -a music stream is already playing it will be stopped. This does not start -the music playing.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.play"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">play</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.play" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Start the playback of the music stream</span></div> -<div class="line"><span class="signature">play(loops=0, start=0.0) -> None</span></div> -</div> -<p>This will play the loaded music stream. If the music is already playing it -will be restarted.</p> -<p>The loops argument controls the number of repeats a music will play. -<tt class="docutils literal"><span class="pre">play(5)</span></tt> will cause the music to played once, then repeated five times, -for a total of six. If the loops is -1 then the music will repeat -indefinitely.</p> -<p>The starting position argument controls where in the music the song starts -playing. The starting position is dependent on the format of music playing. -<tt class="docutils literal"><span class="pre">MP3</span></tt> and <tt class="docutils literal"><span class="pre">OGG</span></tt> use the position as time (in seconds). <tt class="docutils literal"><span class="pre">MOD</span></tt> music it -is the pattern order number. Passing a startpos will raise a -NotImplementedError if it cannot set the start position</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.rewind"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">rewind</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.rewind" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">restart music</span></div> -<div class="line"><span class="signature">rewind() -> None</span></div> -</div> -<p>Resets playback of the current music to the beginning.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.stop"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.stop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop the music playback</span></div> -<div class="line"><span class="signature">stop() -> None</span></div> -</div> -<p>Stops the music playback if it is currently playing.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.pause"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">pause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.pause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">temporarily stop music playback</span></div> -<div class="line"><span class="signature">pause() -> None</span></div> -</div> -<p>Temporarily stop playback of the music stream. It can be resumed with the -<tt class="docutils literal"><span class="pre">pygame.mixer.music.unpause()</span></tt> function.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.unpause"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">unpause</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.unpause" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">resume paused music</span></div> -<div class="line"><span class="signature">unpause() -> None</span></div> -</div> -<p>This will resume the playback of a music stream after it has been paused.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.fadeout"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">fadeout</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.fadeout" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">stop music playback after fading out</span></div> -<div class="line"><span class="signature">fadeout(time) -> None</span></div> -</div> -<p>This will stop the music playback after it has been faded out over the -specified time (measured in milliseconds).</p> -<p>Note, that this function blocks until the music has faded out.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.set_volume"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">set_volume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.set_volume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the music volume</span></div> -<div class="line"><span class="signature">set_volume(value) -> None</span></div> -</div> -<p>Set the volume of the music playback. The value argument is between 0.0 and -1.0. When new music is loaded the volume is reset.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.get_volume"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">get_volume</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.get_volume" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the music volume</span></div> -<div class="line"><span class="signature">get_volume() -> value</span></div> -</div> -<p>Returns the current volume for the mixer. The value will be between 0.0 and -1.0.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.get_busy"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">get_busy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.get_busy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">check if the music stream is playing</span></div> -<div class="line"><span class="signature">get_busy() -> bool</span></div> -</div> -<p>Returns True when the music stream is actively playing. When the music is -idle this returns False.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.set_pos"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">set_pos</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.set_pos" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set position to play from</span></div> -<div class="line"><span class="signature">set_pos(pos) -> None</span></div> -</div> -<p>This sets the position in the music file where playback will start. The -meaning of “pos”, a float (or a number that can be converted to a float), -depends on the music format. Newer versions of SDL_mixer have better -positioning support than earlier. An SDLError is raised if a particular -format does not support positioning.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.get_pos"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">get_pos</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.get_pos" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the music play time</span></div> -<div class="line"><span class="signature">get_pos() -> time</span></div> -</div> -<p>This gets the number of milliseconds that the music has been playing for. -The returned time only represents how long the music has been playing; it -does not take into account any starting position offsets.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.queue"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">queue</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.queue" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">queue a music file to follow the current</span></div> -<div class="line"><span class="signature">queue(filename) -> None</span></div> -</div> -<p>This will load a music file and queue it. A queued music file will begin as -soon as the current music naturally ends. If the current music is ever -stopped or changed, the queued song will be lost.</p> -<p>The following example will play music by Bach six times, then play music by -Mozart once:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pygame</span><span class="o">.</span><span class="n">mixer</span><span class="o">.</span><span class="n">music</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s">'bach.ogg'</span><span class="p">)</span> -<span class="n">pygame</span><span class="o">.</span><span class="n">mixer</span><span class="o">.</span><span class="n">music</span><span class="o">.</span><span class="n">play</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="c"># Plays six times, not five!</span> -<span class="n">pygame</span><span class="o">.</span><span class="n">mixer</span><span class="o">.</span><span class="n">music</span><span class="o">.</span><span class="n">queue</span><span class="p">(</span><span class="s">'mozart.ogg'</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.set_endevent"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">set_endevent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.set_endevent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">have the music send an event when playback stops</span></div> -<div class="line"><span class="signature">set_endevent() -> None</span></div> -<div class="line"><span class="signature">set_endevent(type) -> None</span></div> -</div> -<p>This causes Pygame to signal (by means of the event queue) when the music is -done playing. The argument determines the type of event that will be queued.</p> -<p>The event will be queued every time the music finishes, not just the first -time. To stop the event from being queued, call this method with no -argument.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.mixer.music.get_endevent"> -<tt class="descclassname">pygame.mixer.music.</tt><tt class="descname">get_endevent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.mixer.music.get_endevent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the event a channel sends when playback stops</span></div> -<div class="line"><span class="signature">get_endevent() -> type</span></div> -</div> -<p>Returns the event type to be sent every time the music finishes playback. If -there is no endevent the function returns <tt class="docutils literal"><span class="pre">pygame.NOEVENT</span></tt>.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="overlay.html" title="pygame.Overlay" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="movie.html" title="pygame.movie" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/overlay.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,211 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.Overlay — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.PixelArray" href="pixelarray.html" /> - <link rel="prev" title="pygame.mixer.music" href="music.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="pygame-overlay"> -<dl class="definition class"> -<dt class="title" id="pygame.Overlay"> -<em class="property">class </em><tt class="descclassname">pygame.</tt><tt class="descname">Overlay</tt><a class="headerlink" href="#pygame.Overlay" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame object for video overlay graphics</span></div> -<div class="line"><span class="signature">Overlay(format, (width, height)) -> Overlay</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="35%" /> -<col width="1%" /> -<col width="64%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="overlay.html#pygame.Overlay.display">pygame.Overlay.display</a></td> -<td>—</td> -<td>set the overlay pixel data</td> -</tr> -<tr><td><a class="toc reference external" href="overlay.html#pygame.Overlay.set_location">pygame.Overlay.set_location</a></td> -<td>—</td> -<td>control where the overlay is displayed</td> -</tr> -<tr><td><a class="toc reference external" href="overlay.html#pygame.Overlay.get_hardware">pygame.Overlay.get_hardware</a></td> -<td>—</td> -<td>test if the Overlay is hardware accelerated</td> -</tr> -</tbody> -</table> -<p>The Overlay objects provide support for accessing hardware video overlays. -Video overlays do not use standard <tt class="docutils literal"><span class="pre">RGB</span></tt> pixel formats, and can use -multiple resolutions of data to create a single image.</p> -<p>The Overlay objects represent lower level access to the display hardware. To -use the object you must understand the technical details of video overlays.</p> -<p>The Overlay format determines the type of pixel data used. Not all hardware -will support all types of overlay formats. Here is a list of available -format types:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">YV12_OVERLAY</span><span class="p">,</span> <span class="n">IYUV_OVERLAY</span><span class="p">,</span> <span class="n">YUV2_OVERLAY</span><span class="p">,</span> <span class="n">UYVY_OVERLAY</span><span class="p">,</span> <span class="n">YVYU_OVERLAY</span> -</pre></div> -</div> -<p>The width and height arguments control the size for the overlay image data. -The overlay image can be displayed at any size, not just the resolution of -the overlay.</p> -<p>The overlay objects are always visible, and always show above the regular -display contents.</p> -<dl class="definition method"> -<dt class="title" id="pygame.Overlay.display"> -<tt class="descname">display</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Overlay.display" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the overlay pixel data</span></div> -<div class="line"><span class="signature">display((y, u, v)) -> None</span></div> -<div class="line"><span class="signature">display() -> None</span></div> -</div> -<p>Display the yuv data in SDL’s overlay planes. The y, u, and v arguments -are strings of binary data. The data must be in the correct format used -to create the Overlay.</p> -<p>If no argument is passed in, the Overlay will simply be redrawn with the -current data. This can be useful when the Overlay is not really hardware -accelerated.</p> -<p>The strings are not validated, and improperly sized strings could crash -the program.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Overlay.set_location"> -<tt class="descname">set_location</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Overlay.set_location" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">control where the overlay is displayed</span></div> -<div class="line"><span class="signature">set_location(rect) -> None</span></div> -</div> -<p>Set the location for the overlay. The overlay will always be shown -relative to the main display Surface. This does not actually redraw the -overlay, it will be updated on the next call to <tt class="docutils literal"><span class="pre">Overlay.display()</span></tt>.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Overlay.get_hardware"> -<tt class="descname">get_hardware</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Overlay.get_hardware" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if the Overlay is hardware accelerated</span></div> -<div class="line"><span class="signature">get_hardware(rect) -> int</span></div> -</div> -<p>Returns a True value when the Overlay is hardware accelerated. If the -platform does not support acceleration, software rendering is used.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="pixelarray.html" title="pygame.PixelArray" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="music.html" title="pygame.mixer.music" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/pixelarray.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,418 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.PixelArray — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.pixelcopy" href="pixelcopy.html" /> - <link rel="prev" title="pygame.Overlay" href="overlay.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="pygame-pixelarray"> -<dl class="definition class"> -<dt class="title" id="pygame.PixelArray"> -<em class="property">class </em><tt class="descclassname">pygame.</tt><tt class="descname">PixelArray</tt><a class="headerlink" href="#pygame.PixelArray" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame object for direct pixel access of surfaces</span></div> -<div class="line"><span class="signature">PixelArray(Surface) -> PixelArray</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="31%" /> -<col width="1%" /> -<col width="68%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.surface">pygame.PixelArray.surface</a></td> -<td>—</td> -<td>Gets the Surface the PixelArray uses.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.itemsize">pygame.PixelArray.itemsize</a></td> -<td>—</td> -<td>Returns the byte size of a pixel array item</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.ndim">pygame.PixelArray.ndim</a></td> -<td>—</td> -<td>Returns the number of dimensions.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.shape">pygame.PixelArray.shape</a></td> -<td>—</td> -<td>Returns the array size.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.strides">pygame.PixelArray.strides</a></td> -<td>—</td> -<td>Returns byte offsets for each array dimension.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.make_surface">pygame.PixelArray.make_surface</a></td> -<td>—</td> -<td>Creates a new Surface from the current PixelArray.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.replace">pygame.PixelArray.replace</a></td> -<td>—</td> -<td>Replaces the passed color in the PixelArray with another one.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.extract">pygame.PixelArray.extract</a></td> -<td>—</td> -<td>Extracts the passed color from the PixelArray.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.compare">pygame.PixelArray.compare</a></td> -<td>—</td> -<td>Compares the PixelArray with another one.</td> -</tr> -<tr><td><a class="toc reference external" href="pixelarray.html#pygame.PixelArray.transpose">pygame.PixelArray.transpose</a></td> -<td>—</td> -<td>Exchanges the x and y axis.</td> -</tr> -</tbody> -</table> -<p>The PixelArray wraps a Surface and provides direct access to the -surface’s pixels. A pixel array can be one or two dimensional. -A two dimensional array, like its surface, is indexed [column, row]. -Pixel arrays support slicing, both for returning a subarray or -for assignment. A pixel array sliced on a single column or row -returns a one dimensional pixel array. Arithmetic and other operations -are not supported. A pixel array can be safely assigned to itself. -Finally, pixel arrays export an array struct interface, allowing -them to interact with <a class="tooltip reference internal" href="pixelcopy.html#module-pygame.pixelcopy" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.pixelcopy</span></tt><span class="tooltip-content">pygame module for general pixel array copying</span></a> methods and NumPy -arrays.</p> -<p>A PixelArray pixel item can be assigned a raw integer values, a -<a class="tooltip reference internal" href="color.html#pygame.Color" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.Color</span></tt><span class="tooltip-content">pygame object for color representations</span></a> instance, or a (r, g, b[, a]) tuple.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pxarray</span><span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">]</span> <span class="o">=</span> <span class="mh">0xFF00FF</span> -<span class="n">pxarray</span><span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">]</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">Color</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> -<span class="n">pxarray</span><span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">255</span><span class="p">)</span> -</pre></div> -</div> -<p>However, only a pixel’s integer value is returned. So, to compare a pixel -to a particular color the color needs to be first mapped using -the <a class="reference internal" href="surface.html#pygame.Surface.map_rgb" title="pygame.Surface.map_rgb"><tt class="xref py py-meth docutils literal"><span class="pre">Surface.map_rgb()</span></tt></a> method of the Surface object for which the -PixelArray was created.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pxarray</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">PixelArray</span><span class="p">(</span><span class="n">surface</span><span class="p">)</span> -<span class="c"># Check, if the first pixel at the topleft corner is blue</span> -<span class="k">if</span> <span class="n">pxarray</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">surface</span><span class="o">.</span><span class="n">map_rgb</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">255</span><span class="p">)):</span> - <span class="o">...</span> -</pre></div> -</div> -<p>When assigning to a range of of pixels, a non tuple sequence of colors or -a PixelArray can be used as the value. For a sequence, the length must -match the PixelArray width.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pxarray</span><span class="p">[</span><span class="n">a</span><span class="p">:</span><span class="n">b</span><span class="p">]</span> <span class="o">=</span> <span class="mh">0xFF00FF</span> <span class="c"># set all pixels to 0xFF00FF</span> -<span class="n">pxarray</span><span class="p">[</span><span class="n">a</span><span class="p">:</span><span class="n">b</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mh">0xFF00FF</span><span class="p">,</span> <span class="mh">0xAACCEE</span><span class="p">,</span> <span class="o">...</span> <span class="p">)</span> <span class="c"># first pixel = 0xFF00FF,</span> - <span class="c"># second pixel = 0xAACCEE, ...</span> -<span class="n">pxarray</span><span class="p">[</span><span class="n">a</span><span class="p">:</span><span class="n">b</span><span class="p">]</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">255</span><span class="p">),</span> <span class="p">(</span><span class="mi">170</span><span class="p">,</span> <span class="mi">204</span><span class="p">,</span> <span class="mi">238</span><span class="p">),</span> <span class="o">...</span><span class="p">]</span> <span class="c"># same as above</span> -<span class="n">pxarray</span><span class="p">[</span><span class="n">a</span><span class="p">:</span><span class="n">b</span><span class="p">]</span> <span class="o">=</span> <span class="p">[(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">255</span><span class="p">),</span> <span class="mh">0xAACCEE</span><span class="p">,</span> <span class="o">...</span><span class="p">]</span> <span class="c"># same as above</span> -<span class="n">pxarray</span><span class="p">[</span><span class="n">a</span><span class="p">:</span><span class="n">b</span><span class="p">]</span> <span class="o">=</span> <span class="n">otherarray</span><span class="p">[</span><span class="n">x</span><span class="p">:</span><span class="n">y</span><span class="p">]</span> <span class="c"># slice sizes must match</span> -</pre></div> -</div> -<p>For PixelArray assignment, if the right hand side array has a row length -of 1, then the column is broadcast over the target array’s rows. An -array of height 1 is broadcast over the target’s columns, and is equivalent -to assigning a 1D PixelArray.</p> -<p>Subscipt slices can also be used to assign to a rectangular subview of -the target PixelArray.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="c"># Create some new PixelArray objects providing a different view</span> -<span class="c"># of the original array/surface.</span> -<span class="n">newarray</span> <span class="o">=</span> <span class="n">pxarray</span><span class="p">[</span><span class="mi">2</span><span class="p">:</span><span class="mi">4</span><span class="p">,</span> <span class="mi">3</span><span class="p">:</span><span class="mi">5</span><span class="p">]</span> -<span class="n">otherarray</span> <span class="o">=</span> <span class="n">pxarray</span><span class="p">[::</span><span class="mi">2</span><span class="p">,</span> <span class="p">::</span><span class="mi">2</span><span class="p">]</span> -</pre></div> -</div> -<p>Subscript slices can also be used to do fast rectangular pixel manipulations -instead of iterating over the x or y axis. The</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pxarray</span><span class="p">[::</span><span class="mi">2</span><span class="p">,</span> <span class="p">:]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="c"># Make even columns black.</span> -<span class="n">pxarray</span><span class="p">[::</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="c"># Same as [::2, :]</span> -</pre></div> -</div> -<p>During its lifetime, the PixelArray locks the surface, thus you explicitly -have to delete it once its not used anymore and the surface should perform -operations in the same scope. A simple <tt class="docutils literal"><span class="pre">:</span></tt> slice index for the column can -be omitted.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pxarray</span><span class="p">[::</span><span class="mi">2</span><span class="p">,</span> <span class="o">...</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="c"># Same as pxarray[::2, :]</span> -<span class="n">pxarray</span><span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="c"># Same as pxarray[:]</span> -</pre></div> -</div> -<p>A note about PixelArray to PixelArray assignment, for arrays with an -item size of 3 (created from 24 bit surfaces) pixel values are translated -from the source to the destinations format. The red, green, and blue -color elements of each pixel are shifted to match the format of the -target surface. For all other pixel sizes no such remapping occurs. -This should change in later Pygame releases, where format conversions -are performed for all pixel sizes. To avoid code breakage when full mapped -copying is implemented it is suggested PixelArray to PixelArray copies be -only between surfaces of identical format.</p> -<p>New in pygame 1.9.2</p> -<blockquote> -<ul class="simple"> -<li>array struct interface</li> -<li>transpose method</li> -<li>broadcasting for a length 1 dimension</li> -</ul> -</blockquote> -<p>Changed in pyame 1.9.2</p> -<blockquote> -<ul class="simple"> -<li>A 2D PixelArray can have a length 1 dimension. -Only an integer index on a 2D PixelArray returns a 1D array.</li> -<li>For assignment, a tuple can only be a color. Any other sequence type -is a sequence of colors.</li> -</ul> -</blockquote> -<dl class="definition attribute"> -<dt class="title" id="pygame.PixelArray.surface"> -<tt class="descname">surface</tt><a class="headerlink" href="#pygame.PixelArray.surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the Surface the PixelArray uses.</span></div> -<div class="line"><span class="signature">surface -> Surface</span></div> -</div> -<p>The Surface the PixelArray was created for.</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.PixelArray.itemsize"> -<tt class="descname">itemsize</tt><a class="headerlink" href="#pygame.PixelArray.itemsize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the byte size of a pixel array item</span></div> -<div class="line"><span class="signature">itemsize -> int</span></div> -</div> -<p>This is the same as <a class="reference internal" href="surface.html#pygame.Surface.get_bytesize" title="pygame.Surface.get_bytesize"><tt class="xref py py-meth docutils literal"><span class="pre">Surface.get_bytesize()</span></tt></a> for the -pixel array’s surface.</p> -<p>New in pygame 1.9.2</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.PixelArray.ndim"> -<tt class="descname">ndim</tt><a class="headerlink" href="#pygame.PixelArray.ndim" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the number of dimensions.</span></div> -<div class="line"><span class="signature">ndim -> int</span></div> -</div> -<p>A pixel array can be 1 or 2 dimensional.</p> -<p>New in pygame 1.9.2</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.PixelArray.shape"> -<tt class="descname">shape</tt><a class="headerlink" href="#pygame.PixelArray.shape" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns the array size.</span></div> -<div class="line"><span class="signature">shape -> tuple of int’s</span></div> -</div> -<p>A tuple or length <a class="reference internal" href="#pygame.PixelArray.ndim" title="pygame.PixelArray.ndim"><tt class="xref py py-attr docutils literal"><span class="pre">ndim</span></tt></a> giving the length of each -dimension. Analogous to <a class="reference internal" href="surface.html#pygame.Surface.get_size" title="pygame.Surface.get_size"><tt class="xref py py-meth docutils literal"><span class="pre">Surface.get_size()</span></tt></a>.</p> -<p>New in pygame 1.9.2</p> -</dd></dl> - -<dl class="definition attribute"> -<dt class="title" id="pygame.PixelArray.strides"> -<tt class="descname">strides</tt><a class="headerlink" href="#pygame.PixelArray.strides" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Returns byte offsets for each array dimension.</span></div> -<div class="line"><span class="signature">strides -> tuple of int’s</span></div> -</div> -<p>A tuple or length <a class="reference internal" href="#pygame.PixelArray.ndim" title="pygame.PixelArray.ndim"><tt class="xref py py-attr docutils literal"><span class="pre">ndim</span></tt></a> byte counts. When a stride is -multiplied by the corresponding index it gives the offset -of that index from the start of the array. A stride is negative -for an array that has is inverted (has a negative step).</p> -<p>New in pygame 1.9.2</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.PixelArray.make_surface"> -<tt class="descname">make_surface</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.PixelArray.make_surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Creates a new Surface from the current PixelArray.</span></div> -<div class="line"><span class="signature">make_surface() -> Surface</span></div> -</div> -<p>Creates a new Surface from the current PixelArray. Depending on the -current PixelArray the size, pixel order etc. will be different from the -original Surface.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="c"># Create a new surface flipped around the vertical axis.</span> -<span class="n">sf</span> <span class="o">=</span> <span class="n">pxarray</span><span class="p">[:,::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">make_surface</span> <span class="p">()</span> -</pre></div> -</div> -<p>New in pygame 1.8.1.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.PixelArray.replace"> -<tt class="descname">replace</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.PixelArray.replace" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Replaces the passed color in the PixelArray with another one.</span></div> -<div class="line"><span class="signature">replace(color, repcolor, distance=0, weights=(0.299, 0.587, 0.114)) -> None</span></div> -</div> -<p>Replaces the pixels with the passed color in the PixelArray by changing -them them to the passed replacement color.</p> -<p>It uses a simple weighted euclidian distance formula to calculate the -distance between the colors. The distance space ranges from 0.0 to 1.0 -and is used as threshold for the color detection. This causes the -replacement to take pixels with a similar, but not exactly identical -color, into account as well.</p> -<p>This is an in place operation that directly affects the pixels of the -PixelArray.</p> -<p>New in pygame 1.8.1.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.PixelArray.extract"> -<tt class="descname">extract</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.PixelArray.extract" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Extracts the passed color from the PixelArray.</span></div> -<div class="line"><span class="signature">extract(color, distance=0, weights=(0.299, 0.587, 0.114)) -> PixelArray</span></div> -</div> -<p>Extracts the passed color by changing all matching pixels to white, while -non-matching pixels are changed to black. This returns a new PixelArray -with the black/white color mask.</p> -<p>It uses a simple weighted euclidian distance formula to calculate the -distance between the colors. The distance space ranges from 0.0 to 1.0 -and is used as threshold for the color detection. This causes the -extraction to take pixels with a similar, but not exactly identical -color, into account as well.</p> -<p>New in pygame 1.8.1.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.PixelArray.compare"> -<tt class="descname">compare</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.PixelArray.compare" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Compares the PixelArray with another one.</span></div> -<div class="line"><span class="signature">compare(array, distance=0, weights=(0.299, 0.587, 0.114)) -> PixelArray</span></div> -</div> -<p>Compares the contents of the PixelArray with those from the passed -PixelArray. It returns a new PixelArray with a black/white color mask -that indicates the differences (white) of both arrays. Both PixelArray -objects must have indentical bit depths and dimensions.</p> -<p>It uses a simple weighted euclidian distance formula to calculate the -distance between the colors. The distance space ranges from 0.0 to 1.0 -and is used as threshold for the color detection. This causes the -comparision to mark pixels with a similar, but not exactly identical -color, as black.</p> -<p>New in pygame 1.8.1.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.PixelArray.transpose"> -<tt class="descname">transpose</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.PixelArray.transpose" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Exchanges the x and y axis.</span></div> -<div class="line"><span class="signature">transpose() -> PixelArray</span></div> -</div> -<p>This method returns a new view of the pixel array with the rows and -columns swapped. So for a (w, h) sized array a (h, w) slice is returned. -If an array is one dimensional, then a length 1 x dimension is added, -resulting in a 2D pixel array.</p> -<p>New in pygame 1.9.2</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="pixelcopy.html" title="pygame.pixelcopy" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="overlay.html" title="pygame.Overlay" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/pixelcopy.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.pixelcopy — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame" href="pygame.html" /> - <link rel="prev" title="pygame.PixelArray" href="pixelarray.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.pixelcopy"> -<span id="pygame-pixelcopy"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.pixelcopy</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for general pixel array copying</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="36%" /> -<col width="1%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="pixelcopy.html#pygame.pixelcopy.surface_to_array">pygame.pixelcopy.surface_to_array</a></td> -<td>—</td> -<td>copy surface pixels to an array object</td> -</tr> -<tr><td><a class="toc reference external" href="pixelcopy.html#pygame.pixelcopy.array_to_surface">pygame.pixelcopy.array_to_surface</a></td> -<td>—</td> -<td>copy an array object to a surface</td> -</tr> -<tr><td><a class="toc reference external" href="pixelcopy.html#pygame.pixelcopy.map_array">pygame.pixelcopy.map_array</a></td> -<td>—</td> -<td>copy an array to another array, using surface format</td> -</tr> -<tr><td><a class="toc reference external" href="pixelcopy.html#pygame.pixelcopy.make_surface">pygame.pixelcopy.make_surface</a></td> -<td>—</td> -<td>Copy an array to a new surface</td> -</tr> -</tbody> -</table> -<p>EXPERIMENTAL, though any future changes are likely to be backward-compatible.</p> -<p>The <a class="tooltip reference internal" href="#module-pygame.pixelcopy" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.pixelcopy</span></tt><span class="tooltip-content">pygame module for general pixel array copying</span></a> module contains methods for copying between -surfaces and objects exporting an array structure interface. It is a backend -for <a class="tooltip reference internal" href="surfarray.html#module-pygame.surfarray" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.surfarray</span></tt><span class="tooltip-content">pygame module for accessing surface pixel data using array interfaces</span></a>, adding NumPy support. But pixelcopy is more, -general, and intended for direct use (see the -<tt class="xref py py-func docutils literal"><span class="pre">pygame.examples.pixelcopy.main()</span></tt> example.</p> -<p>The array struct interface exposes an array’s data in a standard way. -It was introduced in NumPy. In Python 2.7 and above it is replaced by the -new buffer protocol, though the buffer protocol is still a work in progress. -The array struct interface, on the other hand, is stable and works with earlier -Python versions. So for now the array struct interface is the predominate way -Pygame handles array introspection.</p> -<p>New in pygame 1.9.2.</p> -<dl class="definition function"> -<dt class="title" id="pygame.pixelcopy.surface_to_array"> -<tt class="descclassname">pygame.pixelcopy.</tt><tt class="descname">surface_to_array</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.pixelcopy.surface_to_array" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">copy surface pixels to an array object</span></div> -<div class="line"><span class="signature">surface_to_array(array, surface, kind=’P’, opaque=255, clear=0) -> None</span></div> -</div> -<p>The surface_to_array function copies pixels from a Surface object -to a 2D or 3D array. Depending on argument <tt class="docutils literal"><span class="pre">kind</span></tt> and the target array -dimension, a copy may be raw pixel value, RGB, a color component slice, -or colorkey alpha transparency value. Recognized <tt class="docutils literal"><span class="pre">kind</span></tt> values are the -single character codes ‘P’, ‘R’, ‘G’, ‘B’, ‘A’, and ‘C’. Kind codes are case -insensitive, so ‘p’ is equivalent to ‘P’. The first two dimensions -of the target must be the surface size (w, h).</p> -<p>The default ‘P’ kind code does a direct raw integer pixel (mapped) value -copy to a 2D array and a ‘RGB’ pixel component (unmapped) copy to a 3D array -having shape (w, h, 3). For an 8 bit colormap surface this means the -table index is copied to a 2D array, not the table value itself. A 2D -array’s item size must be at least as large as the surface’s pixel -byte size. The item size of a 3D array must be at least one byte.</p> -<p>For the ‘R’, ‘G’, ‘B’, and ‘A’ copy kinds a single color component -of the unmapped surface pixels are copied to the target 2D array. -For kind ‘A’ and surfaces with source alpha (the surface was created with -the SRCALPHA flag), has a colorkey (set with <tt class="xref py py-meth docutils literal"><span class="pre">Surface.set_colorkey()</span></tt>), -or has a blanket alpha (set with <tt class="xref py py-meth docutils literal"><span class="pre">Surface.set_alpha()</span></tt>) then the -alpha values are those expected for a SDL surface. If a surface has -no explicit alpha value, then the target array is filled with the -value of the optional <tt class="docutils literal"><span class="pre">opaque</span></tt> surface_to_array argument (default -255: not transparent).</p> -<p>Copy kind ‘C’ is a special case for alpha copy of a source surface -with colorkey. Unlike the ‘A’ color component copy, the <tt class="docutils literal"><span class="pre">clear</span></tt> -argument value is used for colorkey matches, <tt class="docutils literal"><span class="pre">opaque</span></tt> otherwise. -By default, a match has alpha 0 (totally transparent), while everything -else is alpha 255 (totally opaque). It is a more general implementation -of <a class="tooltip reference internal" href="surfarray.html#pygame.surfarray.array_colorkey" title=""><tt class="xref py py-meth docutils literal"><span class="pre">pygame.surfarray.array_colorkey()</span></tt><span class="tooltip-content">Copy the colorkey values into a 2d array</span></a>.</p> -<p>Specific to surface_to_array, a ValueError is raised for target arrays -with incorrect shape or item size. A TypeError is raised for an incorrect -kind code. Surface specific problems, such as locking, raise a pygame.error.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.pixelcopy.array_to_surface"> -<tt class="descclassname">pygame.pixelcopy.</tt><tt class="descname">array_to_surface</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.pixelcopy.array_to_surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">copy an array object to a surface</span></div> -<div class="line"><span class="signature">array_to_surface(<surface>, <array>) -> None</span></div> -</div> -<p>See <a class="tooltip reference internal" href="surfarray.html#pygame.surfarray.blit_array" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.surfarray.blit_array()</span></tt><span class="tooltip-content">Blit directly from a array values</span></a>.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.pixelcopy.map_array"> -<tt class="descclassname">pygame.pixelcopy.</tt><tt class="descname">map_array</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.pixelcopy.map_array" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">copy an array to another array, using surface format</span></div> -<div class="line"><span class="signature">map_array(<array>, <array>, <surface>) -> None</span></div> -</div> -<p>Map an array of color element values - (w, h, ..., 3) - to an array of -pixels - (w, h) according to the format of <<urface>.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.pixelcopy.make_surface"> -<tt class="descclassname">pygame.pixelcopy.</tt><tt class="descname">make_surface</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.pixelcopy.make_surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Copy an array to a new surface</span></div> -<div class="line"><span class="signature">pygame.pixelcopy.make_surface(array) -> Surface</span></div> -</div> -<p>Create a new Surface that best resembles the data and format of the array. -The array can be 2D or 3D with any sized integer values.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="pygame.html" title="pygame" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="pixelarray.html" title="pygame.PixelArray" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/pygame.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,398 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.Rect" href="rect.html" /> - <link rel="prev" title="pygame.pixelcopy" href="pixelcopy.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame"> -<span id="pygame"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the top level pygame package</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="29%" /> -<col width="1%" /> -<col width="70%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="pygame.html#pygame.init">pygame.init</a></td> -<td>—</td> -<td>initialize all imported pygame modules</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.quit">pygame.quit</a></td> -<td>—</td> -<td>uninitialize all pygame modules</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.error">pygame.error</a></td> -<td>—</td> -<td>standard pygame exception</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.get_error">pygame.get_error</a></td> -<td>—</td> -<td>get the current error message</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.set_error">pygame.set_error</a></td> -<td>—</td> -<td>set the current error message</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.get_sdl_version">pygame.get_sdl_version</a></td> -<td>—</td> -<td>get the version number of SDL</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.get_sdl_byteorder">pygame.get_sdl_byteorder</a></td> -<td>—</td> -<td>get the byte order of SDL</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.register_quit">pygame.register_quit</a></td> -<td>—</td> -<td>register a function to be called when pygame quits</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.encode_string">pygame.encode_string</a></td> -<td>—</td> -<td>Encode a unicode or bytes object</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.encode_file_path">pygame.encode_file_path</a></td> -<td>—</td> -<td>Encode a unicode or bytes object as a file system path</td> -</tr> -</tbody> -</table> -<p>The pygame package represents the top-level package for others to use. Pygame -itself is broken into many submodules, but this does not affect programs that -use Pygame.</p> -<p>As a convenience, most of the top-level variables in pygame have been placed -inside a module named ‘pygame.locals’. This is meant to be used with ‘from -<a class="tooltip reference internal" href="locals.html#module-pygame.locals" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.locals</span></tt><span class="tooltip-content">pygame constants</span></a> import *’, in addition to ‘import pygame’.</p> -<p>When you ‘import pygame’ all available pygame submodules are automatically -imported. Be aware that some of the pygame modules are considered “optional”, -and may not be available. In that case, Pygame will provide a placeholder -object instead of the module, which can be used to test for availability.</p> -<dl class="definition function"> -<dt class="title" id="pygame.init"> -<tt class="descclassname">pygame.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">initialize all imported pygame modules</span></div> -<div class="line"><span class="signature">init() -> (numpass, numfail)</span></div> -</div> -<p>Initialize all imported Pygame modules. No exceptions will be raised if a -module fails, but the total number if successful and failed inits will be -returned as a tuple. You can always initialize individual modules manually, -but <a class="tooltip reference internal" href="#pygame.init" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.init()</span></tt><span class="tooltip-content">initialize all imported pygame modules</span></a> is a convenient way to get everything started. The -<tt class="docutils literal"><span class="pre">init()</span></tt> functions for individual modules will raise exceptions when they -fail.</p> -<p>You may want to initalise the different modules seperately to speed up your -program or to not use things your game does not.</p> -<p>It is safe to call this <tt class="docutils literal"><span class="pre">init()</span></tt> more than once: repeated calls will have -no effect. This is true even if you have <tt class="docutils literal"><span class="pre">pygame.quit()</span></tt> all the modules.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.quit"> -<tt class="descclassname">pygame.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">uninitialize all pygame modules</span></div> -<div class="line"><span class="signature">quit() -> None</span></div> -</div> -<p>Uninitialize all pygame modules that have previously been initialized. When -the Python interpreter shuts down, this method is called regardless, so your -program should not need it, except when it wants to terminate its pygame -resources and continue. It is safe to call this function more than once: -repeated calls have no effect.</p> -<p>Note, that <a class="tooltip reference internal" href="#pygame.quit" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.quit()</span></tt><span class="tooltip-content">uninitialize all pygame modules</span></a> will not exit your program. Consider letting -your program end in the same way a normal python program will end.</p> -</dd></dl> - -<dl class="definition exception"> -<dt class="title" id="pygame.error"> -<em class="property">exception </em><tt class="descclassname">pygame.</tt><tt class="descname">error</tt><a class="headerlink" href="#pygame.error" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">standard pygame exception</span></div> -<div class="line"><span class="signature">raise pygame.error(message)</span></div> -</div> -<p>This exception is raised whenever a pygame or <tt class="docutils literal"><span class="pre">SDL</span></tt> operation fails. You -can catch any anticipated problems and deal with the error. The exception is -always raised with a descriptive message about the problem.</p> -<p>Derived from the RuntimeError exception, which can also be used to catch -these raised errors.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.get_error"> -<tt class="descclassname">pygame.</tt><tt class="descname">get_error</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.get_error" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current error message</span></div> -<div class="line"><span class="signature">get_error() -> errorstr</span></div> -</div> -<p><tt class="docutils literal"><span class="pre">SDL</span></tt> maintains an internal error message. This message will usually be -given to you when <a class="tooltip reference internal" href="#pygame.error" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.error()</span></tt><span class="tooltip-content">standard pygame exception</span></a> is raised. You will rarely need to -call this function.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.set_error"> -<tt class="descclassname">pygame.</tt><tt class="descname">set_error</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.set_error" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the current error message</span></div> -<div class="line"><span class="signature">set_error(error_msg) -> None</span></div> -</div> -<p><tt class="docutils literal"><span class="pre">SDL</span></tt> maintains an internal error message. This message will usually be -given to you when <a class="tooltip reference internal" href="#pygame.error" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.error()</span></tt><span class="tooltip-content">standard pygame exception</span></a> is raised. You will rarely need to -call this function.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.get_sdl_version"> -<tt class="descclassname">pygame.</tt><tt class="descname">get_sdl_version</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.get_sdl_version" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the version number of SDL</span></div> -<div class="line"><span class="signature">get_sdl_version() -> major, minor, patch</span></div> -</div> -<p>Returns the three version numbers of the <tt class="docutils literal"><span class="pre">SDL</span></tt> library. This version is -built at compile time. It can be used to detect which features may not be -available through Pygame.</p> -<p>get_sdl_version is new in pygame 1.7.0</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.get_sdl_byteorder"> -<tt class="descclassname">pygame.</tt><tt class="descname">get_sdl_byteorder</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.get_sdl_byteorder" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the byte order of SDL</span></div> -<div class="line"><span class="signature">get_sdl_byteorder() -> int</span></div> -</div> -<p>Returns the byte order of the <tt class="docutils literal"><span class="pre">SDL</span></tt> library. It returns <tt class="docutils literal"><span class="pre">LIL_ENDIAN</span></tt> for -little endian byte order and <tt class="docutils literal"><span class="pre">BIG_ENDIAN</span></tt> for big endian byte order.</p> -<p>get_sdl_byteorder is new in pygame 1.8</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.register_quit"> -<tt class="descclassname">pygame.</tt><tt class="descname">register_quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.register_quit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">register a function to be called when pygame quits</span></div> -<div class="line"><span class="signature">register_quit(callable) -> None</span></div> -</div> -<p>When <a class="tooltip reference internal" href="#pygame.quit" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.quit()</span></tt><span class="tooltip-content">uninitialize all pygame modules</span></a> is called, all registered quit functions are -called. Pygame modules do this automatically when they are initializing. -This function is not be needed for regular pygame users.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.encode_string"> -<tt class="descclassname">pygame.</tt><tt class="descname">encode_string</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.encode_string" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Encode a unicode or bytes object</span></div> -<div class="line"><span class="signature">encode_string([obj [, encoding [, errors [, etype]]]]) -> bytes or None</span></div> -</div> -<p>obj: If unicode, encode; if bytes, return unaltered; if anything else, -return None; if not given, raise SyntaxError.</p> -<p>encoding (string): If present, encoding to use. The default is -‘unicode_escape’.</p> -<p>errors (string): If given, how to handle unencodable characters. The default -is ‘backslashreplace’.</p> -<p>etype (exception type): If given, the exception type to raise for an -encoding error. The default is UnicodeEncodeError, as returned by -<tt class="docutils literal"><span class="pre">PyUnicode_AsEncodedString()</span></tt>. For the default encoding and errors values -there should be no encoding errors.</p> -<p>This function is used in encoding file paths. Keyword arguments are -supported.</p> -<p>Added in Pygame 1.9.2 (primarily for use in unit tests)</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.encode_file_path"> -<tt class="descclassname">pygame.</tt><tt class="descname">encode_file_path</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.encode_file_path" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Encode a unicode or bytes object as a file system path</span></div> -<div class="line"><span class="signature">encode_file_path([obj [, etype]]) -> bytes or None</span></div> -</div> -<p>obj: If unicode, encode; if bytes, return unaltered; if anything else, -return None; if not given, raise SyntaxError.</p> -<p>etype (exception type): If given, the exception type to raise for an -encoding error. The default is UnicodeEncodeError, as returned by -<tt class="docutils literal"><span class="pre">PyUnicode_AsEncodedString()</span></tt>.</p> -<p>This function is used to encode file paths in Pygame. Encoding is to the -codec as returned by <tt class="docutils literal"><span class="pre">sys.getfilesystemencoding()</span></tt>. Keyword arguments are -supported.</p> -<p>Added in Pygame 1.9.2 (primarily for use in unit tests)</p> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-pygame.version"> -<span id="pygame-version"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.version</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">small module containing version information</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="36%" /> -<col width="2%" /> -<col width="63%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="pygame.html#pygame.version.ver">pygame.version.ver</a></td> -<td>—</td> -<td>version number as a string</td> -</tr> -<tr><td><a class="toc reference external" href="pygame.html#pygame.version.vernum">pygame.version.vernum</a></td> -<td>—</td> -<td>tupled integers of the version</td> -</tr> -</tbody> -</table> -<p>This module is automatically imported into the pygame package and offers a few -variables to check with version of pygame has been imported.</p> -<dl class="definition data"> -<dt class="title" id="pygame.version.ver"> -<tt class="descclassname">pygame.version.</tt><tt class="descname">ver</tt><a class="headerlink" href="#pygame.version.ver" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">version number as a string</span></div> -<div class="line"><span class="signature">ver = ‘1.2’</span></div> -</div> -<p>This is the version represented as a string. It can contain a micro release -number as well, <tt class="docutils literal"><span class="pre">e.g.</span></tt>, ‘1.5.2’</p> -</dd></dl> - -<dl class="definition data"> -<dt class="title" id="pygame.version.vernum"> -<tt class="descclassname">pygame.version.</tt><tt class="descname">vernum</tt><a class="headerlink" href="#pygame.version.vernum" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">tupled integers of the version</span></div> -<div class="line"><span class="signature">vernum = (1, 5, 3)</span></div> -</div> -<p>This variable for the version can easily be compared with other version -numbers of the same format. An example of checking Pygame version numbers -would look like this:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="n">pygame</span><span class="o">.</span><span class="n">version</span><span class="o">.</span><span class="n">vernum</span> <span class="o"><</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">):</span> - <span class="k">print</span> <span class="s">'Warning, older version of Pygame (</span><span class="si">%s</span><span class="s">)'</span> <span class="o">%</span> <span class="n">pygame</span><span class="o">.</span><span class="n">version</span><span class="o">.</span><span class="n">ver</span> - <span class="n">disable_advanced_features</span> <span class="o">=</span> <span class="bp">True</span> -</pre></div> -</div> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="rect.html" title="pygame.Rect" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="pixelcopy.html" title="pygame.pixelcopy" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/rect.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,512 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.Rect — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.scrap" href="scrap.html" /> - <link rel="prev" title="pygame" href="pygame.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="pygame-rect"> -<dl class="definition class"> -<dt class="title" id="pygame.Rect"> -<em class="property">class </em><tt class="descclassname">pygame.</tt><tt class="descname">Rect</tt><a class="headerlink" href="#pygame.Rect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame object for storing rectangular coordinates</span></div> -<div class="line"><span class="signature">Rect(left, top, width, height) -> Rect</span></div> -<div class="line"><span class="signature">Rect((left, top), (width, height)) -> Rect</span></div> -<div class="line"><span class="signature">Rect(object) -> Rect</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="32%" /> -<col width="1%" /> -<col width="67%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.copy">pygame.Rect.copy</a></td> -<td>—</td> -<td>copy the rectangle</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.move">pygame.Rect.move</a></td> -<td>—</td> -<td>moves the rectangle</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.move_ip">pygame.Rect.move_ip</a></td> -<td>—</td> -<td>moves the rectangle, in place</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.inflate">pygame.Rect.inflate</a></td> -<td>—</td> -<td>grow or shrink the rectangle size</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.inflate_ip">pygame.Rect.inflate_ip</a></td> -<td>—</td> -<td>grow or shrink the rectangle size, in place</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.clamp">pygame.Rect.clamp</a></td> -<td>—</td> -<td>moves the rectangle inside another</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.clamp_ip">pygame.Rect.clamp_ip</a></td> -<td>—</td> -<td>moves the rectangle inside another, in place</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.clip">pygame.Rect.clip</a></td> -<td>—</td> -<td>crops a rectangle inside another</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.union">pygame.Rect.union</a></td> -<td>—</td> -<td>joins two rectangles into one</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.union_ip">pygame.Rect.union_ip</a></td> -<td>—</td> -<td>joins two rectangles into one, in place</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.unionall">pygame.Rect.unionall</a></td> -<td>—</td> -<td>the union of many rectangles</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.unionall_ip">pygame.Rect.unionall_ip</a></td> -<td>—</td> -<td>the union of many rectangles, in place</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.fit">pygame.Rect.fit</a></td> -<td>—</td> -<td>resize and move a rectangle with aspect ratio</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.normalize">pygame.Rect.normalize</a></td> -<td>—</td> -<td>correct negative sizes</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.contains">pygame.Rect.contains</a></td> -<td>—</td> -<td>test if one rectangle is inside another</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.collidepoint">pygame.Rect.collidepoint</a></td> -<td>—</td> -<td>test if a point is inside a rectangle</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.colliderect">pygame.Rect.colliderect</a></td> -<td>—</td> -<td>test if two rectangles overlap</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.collidelist">pygame.Rect.collidelist</a></td> -<td>—</td> -<td>test if one rectangle in a list intersects</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.collidelistall">pygame.Rect.collidelistall</a></td> -<td>—</td> -<td>test if all rectangles in a list intersect</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.collidedict">pygame.Rect.collidedict</a></td> -<td>—</td> -<td>test if one rectangle in a dictionary intersects</td> -</tr> -<tr><td><a class="toc reference external" href="rect.html#pygame.Rect.collidedictall">pygame.Rect.collidedictall</a></td> -<td>—</td> -<td>test if all rectangles in a dictionary intersect</td> -</tr> -</tbody> -</table> -<p>Pygame uses Rect objects to store and manipulate rectangular areas. A Rect -can be created from a combination of left, top, width, and height values. -Rects can also be created from python objects that are already a Rect or -have an attribute named “rect”.</p> -<p>Any Pygame function that requires a Rect argument also accepts any of these -values to construct a Rect. This makes it easier to create Rects on the fly -as arguments to functions.</p> -<p>The Rect functions that change the position or size of a Rect return a new -copy of the Rect with the affected changes. The original Rect is not -modified. Some methods have an alternate “in-place” version that returns -None but effects the original Rect. These “in-place” methods are denoted -with the “ip” suffix.</p> -<p>The Rect object has several virtual attributes which can be used to move and -align the Rect:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">top</span><span class="p">,</span> <span class="n">left</span><span class="p">,</span> <span class="n">bottom</span><span class="p">,</span> <span class="n">right</span> -<span class="n">topleft</span><span class="p">,</span> <span class="n">bottomleft</span><span class="p">,</span> <span class="n">topright</span><span class="p">,</span> <span class="n">bottomright</span> -<span class="n">midtop</span><span class="p">,</span> <span class="n">midleft</span><span class="p">,</span> <span class="n">midbottom</span><span class="p">,</span> <span class="n">midright</span> -<span class="n">center</span><span class="p">,</span> <span class="n">centerx</span><span class="p">,</span> <span class="n">centery</span> -<span class="n">size</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span> -<span class="n">w</span><span class="p">,</span><span class="n">h</span> -</pre></div> -</div> -<p>All of these attributes can be assigned to:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">rect1</span><span class="o">.</span><span class="n">right</span> <span class="o">=</span> <span class="mi">10</span> -<span class="n">rect2</span><span class="o">.</span><span class="n">center</span> <span class="o">=</span> <span class="p">(</span><span class="mi">20</span><span class="p">,</span><span class="mi">30</span><span class="p">)</span> -</pre></div> -</div> -<p>Assigning to size, width or height changes the dimensions of the rectangle; -all other assignments move the rectangle without resizing it. Notice that -some attributes are integers and others are pairs of integers.</p> -<p>If a Rect has a nonzero width or height, it will return True for a nonzero -test. Some methods return a Rect with 0 size to represent an invalid -rectangle.</p> -<p>The coordinates for Rect objects are all integers. The size values can be -programmed to have negative values, but these are considered illegal Rects -for most operations.</p> -<p>There are several collision tests between other rectangles. Most python -containers can be searched for collisions against a single Rect.</p> -<p>The area covered by a Rect does not include the right- and bottom-most edge -of pixels. If one Rect’s bottom border is another Rect’s top border (i.e., -rect1.bottom=rect2.top), the two meet exactly on the screen but do not -overlap, and <tt class="docutils literal"><span class="pre">rect1.colliderect(rect2)</span></tt> returns false.</p> -<p>Though Rect can be subclassed, methods that return new rectangles are not -subclass aware. That is, move or copy return a new <a class="tooltip reference internal" href="#pygame.Rect" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.Rect</span></tt><span class="tooltip-content">pygame object for storing rectangular coordinates</span></a> -instance, not an instance of the subclass. This may change. To make subclass -awareness work though, subclasses may have to maintain the same constructor -signature as Rect.</p> -<dl class="definition method"> -<dt class="title" id="pygame.Rect.copy"> -<tt class="descname">copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.copy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">copy the rectangle</span></div> -<div class="line"><span class="signature">copy() -> Rect</span></div> -</div> -<p>Returns a new rectangle having the same position and size as the orginal.</p> -<p>New in pygame 1.9</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.move"> -<tt class="descname">move</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.move" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">moves the rectangle</span></div> -<div class="line"><span class="signature">move(x, y) -> Rect</span></div> -</div> -<p>Returns a new rectangle that is moved by the given offset. The x and y -arguments can be any integer value, positive or negative.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.move_ip"> -<tt class="descname">move_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.move_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">moves the rectangle, in place</span></div> -<div class="line"><span class="signature">move_ip(x, y) -> None</span></div> -</div> -<p>Same as the <tt class="docutils literal"><span class="pre">Rect.move()</span></tt> method, but operates in place.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.inflate"> -<tt class="descname">inflate</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.inflate" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">grow or shrink the rectangle size</span></div> -<div class="line"><span class="signature">inflate(x, y) -> Rect</span></div> -</div> -<p>Returns a new rectangle with the size changed by the given offset. The -rectangle remains centered around its current center. Negative values -will shrink the rectangle.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.inflate_ip"> -<tt class="descname">inflate_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.inflate_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">grow or shrink the rectangle size, in place</span></div> -<div class="line"><span class="signature">inflate_ip(x, y) -> None</span></div> -</div> -<p>Same as the <tt class="docutils literal"><span class="pre">Rect.inflate()</span></tt> method, but operates in place.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.clamp"> -<tt class="descname">clamp</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.clamp" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">moves the rectangle inside another</span></div> -<div class="line"><span class="signature">clamp(Rect) -> Rect</span></div> -</div> -<p>Returns a new rectangle that is moved to be completely inside the -argument Rect. If the rectangle is too large to fit inside, it is -centered inside the argument Rect, but its size is not changed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.clamp_ip"> -<tt class="descname">clamp_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.clamp_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">moves the rectangle inside another, in place</span></div> -<div class="line"><span class="signature">clamp_ip(Rect) -> None</span></div> -</div> -<p>Same as the <tt class="docutils literal"><span class="pre">Rect.clamp()</span></tt> method, but operates in place.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.clip"> -<tt class="descname">clip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.clip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">crops a rectangle inside another</span></div> -<div class="line"><span class="signature">clip(Rect) -> Rect</span></div> -</div> -<p>Returns a new rectangle that is cropped to be completely inside the -argument Rect. If the two rectangles do not overlap to begin with, a Rect -with 0 size is returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.union"> -<tt class="descname">union</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.union" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">joins two rectangles into one</span></div> -<div class="line"><span class="signature">union(Rect) -> Rect</span></div> -</div> -<p>Returns a new rectangle that completely covers the area of the two -provided rectangles. There may be area inside the new Rect that is not -covered by the originals.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.union_ip"> -<tt class="descname">union_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.union_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">joins two rectangles into one, in place</span></div> -<div class="line"><span class="signature">union_ip(Rect) -> None</span></div> -</div> -<p>Same as the <tt class="docutils literal"><span class="pre">Rect.union()</span></tt> method, but operates in place.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.unionall"> -<tt class="descname">unionall</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.unionall" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the union of many rectangles</span></div> -<div class="line"><span class="signature">unionall(Rect_sequence) -> Rect</span></div> -</div> -<p>Returns the union of one rectangle with a sequence of many rectangles.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.unionall_ip"> -<tt class="descname">unionall_ip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.unionall_ip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the union of many rectangles, in place</span></div> -<div class="line"><span class="signature">unionall_ip(Rect_sequence) -> None</span></div> -</div> -<p>The same as the <tt class="docutils literal"><span class="pre">Rect.unionall()</span></tt> method, but operates in place.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.fit"> -<tt class="descname">fit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.fit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">resize and move a rectangle with aspect ratio</span></div> -<div class="line"><span class="signature">fit(Rect) -> Rect</span></div> -</div> -<p>Returns a new rectangle that is moved and resized to fit another. The -aspect ratio of the original Rect is preserved, so the new rectangle may -be smaller than the target in either width or height.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.normalize"> -<tt class="descname">normalize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.normalize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">correct negative sizes</span></div> -<div class="line"><span class="signature">normalize() -> None</span></div> -</div> -<p>This will flip the width or height of a rectangle if it has a negative -size. The rectangle will remain in the same place, with only the sides -swapped.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.contains"> -<tt class="descname">contains</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.contains" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if one rectangle is inside another</span></div> -<div class="line"><span class="signature">contains(Rect) -> bool</span></div> -</div> -<p>Returns true when the argument is completely inside the Rect.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.collidepoint"> -<tt class="descname">collidepoint</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.collidepoint" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if a point is inside a rectangle</span></div> -<div class="line"><span class="signature">collidepoint(x, y) -> bool</span></div> -<div class="line"><span class="signature">collidepoint((x,y)) -> bool</span></div> -</div> -<p>Returns true if the given point is inside the rectangle. A point along -the right or bottom edge is not considered to be inside the rectangle.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.colliderect"> -<tt class="descname">colliderect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.colliderect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if two rectangles overlap</span></div> -<div class="line"><span class="signature">colliderect(Rect) -> bool</span></div> -</div> -<p>Returns true if any portion of either rectangle overlap (except the -top+bottom or left+right edges).</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.collidelist"> -<tt class="descname">collidelist</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.collidelist" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if one rectangle in a list intersects</span></div> -<div class="line"><span class="signature">collidelist(list) -> index</span></div> -</div> -<p>Test whether the rectangle collides with any in a sequence of rectangles. -The index of the first collision found is returned. If no collisions are -found an index of -1 is returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.collidelistall"> -<tt class="descname">collidelistall</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.collidelistall" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if all rectangles in a list intersect</span></div> -<div class="line"><span class="signature">collidelistall(list) -> indices</span></div> -</div> -<p>Returns a list of all the indices that contain rectangles that collide -with the Rect. If no intersecting rectangles are found, an empty list is -returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.collidedict"> -<tt class="descname">collidedict</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.collidedict" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if one rectangle in a dictionary intersects</span></div> -<div class="line"><span class="signature">collidedict(dict) -> (key, value)</span></div> -</div> -<p>Returns the key and value of the first dictionary value that collides -with the Rect. If no collisions are found, None is returned.</p> -<p>Rect objects are not hashable and cannot be used as keys in a dictionary, -only as values.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Rect.collidedictall"> -<tt class="descname">collidedictall</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Rect.collidedictall" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if all rectangles in a dictionary intersect</span></div> -<div class="line"><span class="signature">collidedictall(dict) -> [(key, value), ...]</span></div> -</div> -<p>Returns a list of all the key and value pairs that intersect with the -Rect. If no collisions are found an empty dictionary is returned.</p> -<p>Rect objects are not hashable and cannot be used as keys in a dictionary, -only as values.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="scrap.html" title="pygame.scrap" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="pygame.html" title="pygame" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/scrap.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.scrap — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.sndarray" href="sndarray.html" /> - <link rel="prev" title="pygame.Rect" href="rect.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.scrap"> -<span id="pygame-scrap"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.scrap</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for clipboard support.</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="24%" /> -<col width="1%" /> -<col width="75%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="scrap.html#pygame.scrap.init">pygame.scrap.init</a></td> -<td>—</td> -<td>Initializes the scrap module.</td> -</tr> -<tr><td><a class="toc reference external" href="scrap.html#pygame.scrap.get">pygame.scrap.get</a></td> -<td>—</td> -<td>Gets the data for the specified type from the clipboard.</td> -</tr> -<tr><td><a class="toc reference external" href="scrap.html#pygame.scrap.get_types">pygame.scrap.get_types</a></td> -<td>—</td> -<td>Gets a list of the available clipboard types.</td> -</tr> -<tr><td><a class="toc reference external" href="scrap.html#pygame.scrap.put">pygame.scrap.put</a></td> -<td>—</td> -<td>Places data into the clipboard.</td> -</tr> -<tr><td><a class="toc reference external" href="scrap.html#pygame.scrap.contains">pygame.scrap.contains</a></td> -<td>—</td> -<td>Checks, whether a certain type is available in the clipboard.</td> -</tr> -<tr><td><a class="toc reference external" href="scrap.html#pygame.scrap.lost">pygame.scrap.lost</a></td> -<td>—</td> -<td>Checks whether the clipboard is currently owned by the application.</td> -</tr> -<tr><td><a class="toc reference external" href="scrap.html#pygame.scrap.set_mode">pygame.scrap.set_mode</a></td> -<td>—</td> -<td>Sets the clipboard access mode.</td> -</tr> -</tbody> -</table> -<p>EXPERIMENTAL!: meaning this api may change, or dissapear in later pygame -releases. If you use this, your code will break with the next pygame release.</p> -<p>The scrap module is for getting and putting stuff from the clipboard. So you -can copy and paste things between pygame, and other application types. It -defines some basic own data types</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">SCRAP_PPM</span> -<span class="n">SCRAP_PBM</span> -<span class="n">SCRAP_BMP</span> -<span class="n">SCRAP_TEXT</span> -</pre></div> -</div> -<p>to be placed into the clipboard and allows to use define own clipboard types. -<tt class="docutils literal"><span class="pre">SCRAP_PPM</span></tt>, <tt class="docutils literal"><span class="pre">SCRAP_PBM</span></tt> and <tt class="docutils literal"><span class="pre">SCRAP_BMP</span></tt> are suitable for surface buffers -to be shared with other applications, while <tt class="docutils literal"><span class="pre">SCRAP_TEXT</span></tt> is an alias for the -plain text clipboard type.</p> -<p>The SCRAP_* types refer to the following <tt class="docutils literal"><span class="pre">MIME</span></tt> types and register those as -well as the default operating system type for this type of data:</p> -<div class="highlight-python"><pre>SCRAP_TEXT text/plain for plain text -SCRAP_PBM image/pbm for PBM encoded image data -SCRAP_PPM image/ppm for PPM encoded image data -SCRAP_BMP image/bmp for BMP encoded image data</pre> -</div> -<p>Depending on the platform additional types are automatically registered when -data is placed into the clipboard to guarantee a consistent sharing behaviour -with other applications. The following listed types can be used as string to be -passed to the respective <a class="tooltip reference internal" href="#module-pygame.scrap" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.scrap</span></tt><span class="tooltip-content">pygame module for clipboard support.</span></a> module functions.</p> -<p>For Windows platforms, the additional types are supported automatically and -resolve to their internal definitions:</p> -<div class="highlight-python"><pre>text/plain;charset=utf-8 for UTF-8 encoded text -audio/wav for WAV encoded audio -image/tiff for TIFF encoded image data</pre> -</div> -<p>For <tt class="docutils literal"><span class="pre">X11</span></tt> platforms, the additional types are supported automatically and -resolve to their internal definitions:</p> -<div class="highlight-python"><pre>UTF8_STRING for UTF-8 encoded text -text/plain;charset=utf-8 for UTF-8 encoded text -COMPOUND_TEXT for COMPOUND text</pre> -</div> -<p>As stated before you can define own types for the clipboard, those however -might not be usable by other applications. Thus data pasted into the clipboard -using</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">put</span> <span class="p">(</span><span class="s">"own_data"</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span> -</pre></div> -</div> -<p>can only be used by applications, which query the clipboard for the “own_data” -type.</p> -<p>New in pygame 1.8. Only works for Windows, <tt class="docutils literal"><span class="pre">X11</span></tt> and Mac <tt class="docutils literal"><span class="pre">OS</span></tt> <tt class="docutils literal"><span class="pre">X</span></tt> so far. -On Mac <tt class="docutils literal"><span class="pre">OSX</span></tt> only text works at the moment - other types will be supported in -the next release.</p> -<dl class="definition function"> -<dt class="title" id="pygame.scrap.init"> -<tt class="descclassname">pygame.scrap.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.scrap.init" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Initializes the scrap module.</span></div> -<div class="line"><span class="signature">init () -> None</span></div> -</div> -<p>Tries to initialize the scrap module and raises an exception, if it fails. -Note that this module requires a set display surface, so you have to make -sure, you acquired one earlier using <tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt>.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.scrap.get"> -<tt class="descclassname">pygame.scrap.</tt><tt class="descname">get</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.scrap.get" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the data for the specified type from the clipboard.</span></div> -<div class="line"><span class="signature">get (type) -> bytes</span></div> -</div> -<p>Returns the data for the specified type from the clipboard. The data is -returned as a byte string and might need further processing, -such as decoding to Unicode. -If no data for the passed type is available, None is returned.</p> -<div class="highlight-python"><pre>text = pygame.scrap.get (SCRAP_TEXT) -if text: - # Do stuff with it. -else: - print "There does not seem to be text in the clipboard."</pre> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.scrap.get_types"> -<tt class="descclassname">pygame.scrap.</tt><tt class="descname">get_types</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.scrap.get_types" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets a list of the available clipboard types.</span></div> -<div class="line"><span class="signature">get_types () -> list</span></div> -</div> -<p>Gets a list of strings with the identifiers for the available clipboard -types. Each identifier can be used in the <tt class="docutils literal"><span class="pre">scrap.get()</span></tt> method to get the -clipboard content of the specific type. If there is no data in the -clipboard, an empty list is returned.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">types</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">get_types</span> <span class="p">()</span> -<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">types</span><span class="p">:</span> - <span class="k">if</span> <span class="s">"text"</span> <span class="ow">in</span> <span class="n">t</span><span class="p">:</span> - <span class="c"># There is some content with the word "text" in it. It's</span> - <span class="c"># possibly text, so print it.</span> - <span class="k">print</span> <span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">get</span> <span class="p">(</span><span class="n">t</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.scrap.put"> -<tt class="descclassname">pygame.scrap.</tt><tt class="descname">put</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.scrap.put" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Places data into the clipboard.</span></div> -<div class="line"><span class="signature">put(type, data) -> None</span></div> -</div> -<p>Places data for a specific clipboard type into the clipboard. The data must -be a string buffer. The type is a string identifying the type of data placed -into the clipboard. This can be one of the native <tt class="docutils literal"><span class="pre">SCRAP_PBM</span></tt>, -<tt class="docutils literal"><span class="pre">SCRAP_PPM</span></tt>, <tt class="docutils literal"><span class="pre">SCRAP_BMP</span></tt> or <tt class="docutils literal"><span class="pre">SCRAP_TEXT</span></tt> values or an own string -identifier.</p> -<p>The method raises an exception, if the content could not be placed into the -clipboard.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">fp</span> <span class="o">=</span> <span class="nb">open</span> <span class="p">(</span><span class="s">"example.bmp"</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">)</span> -<span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">put</span> <span class="p">(</span><span class="n">SCRAP_BMP</span><span class="p">,</span> <span class="n">fp</span><span class="o">.</span><span class="n">read</span> <span class="p">())</span> -<span class="n">fp</span><span class="o">.</span><span class="n">close</span> <span class="p">()</span> -<span class="c"># Now you can acquire the image data from the clipboard in other</span> -<span class="c"># applications.</span> -<span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">put</span> <span class="p">(</span><span class="n">SCRAP_TEXT</span><span class="p">,</span> <span class="s">"A text to copy"</span><span class="p">)</span> -<span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">put</span> <span class="p">(</span><span class="s">"Plain text"</span><span class="p">,</span> <span class="s">"A text to copy"</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.scrap.contains"> -<tt class="descclassname">pygame.scrap.</tt><tt class="descname">contains</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.scrap.contains" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Checks, whether a certain type is available in the clipboard.</span></div> -<div class="line"><span class="signature">contains (type) -> bool</span></div> -</div> -<p>Returns True, if data for the passed type is available in the clipboard, -False otherwise.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">contains</span> <span class="p">(</span><span class="n">SCRAP_TEXT</span><span class="p">):</span> - <span class="k">print</span> <span class="s">"There is text in the clipboard."</span> -<span class="k">if</span> <span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">contains</span> <span class="p">(</span><span class="s">"own_data_type"</span><span class="p">):</span> - <span class="k">print</span> <span class="s">"There is stuff in the clipboard."</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.scrap.lost"> -<tt class="descclassname">pygame.scrap.</tt><tt class="descname">lost</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.scrap.lost" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Checks whether the clipboard is currently owned by the application.</span></div> -<div class="line"><span class="signature">lost() -> bool</span></div> -</div> -<p>Returns True, if the clipboard is currently owned by the pygame application, -False otherwise.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">if</span> <span class="n">pygame</span><span class="o">.</span><span class="n">scrap</span><span class="o">.</span><span class="n">lost</span> <span class="p">():</span> - <span class="k">print</span> <span class="s">"No content from me anymore. The clipboard is used by someone else."</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.scrap.set_mode"> -<tt class="descclassname">pygame.scrap.</tt><tt class="descname">set_mode</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.scrap.set_mode" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets the clipboard access mode.</span></div> -<div class="line"><span class="signature">set_mode(mode) -> None</span></div> -</div> -<p>Sets the access mode for the clipboard. This is only of interest for <tt class="docutils literal"><span class="pre">X11</span></tt> -environments, where clipboard modes for mouse selections (SRAP_SELECTION) -and the clipboard (SCRAP_CLIPBOARD) are available. Setting the mode to -<tt class="docutils literal"><span class="pre">SCRAP_SELECTION</span></tt> in other environments will not cause any difference.</p> -<p>If a value different from <tt class="docutils literal"><span class="pre">SCRAP_CLIPBOARD</span></tt> or <tt class="docutils literal"><span class="pre">SCRAP_SELECTION</span></tt> is -passed, a ValueError will be raised.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="sndarray.html" title="pygame.sndarray" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="rect.html" title="pygame.Rect" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/sndarray.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.sndarray — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.sprite" href="sprite.html" /> - <link rel="prev" title="pygame.scrap" href="scrap.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.sndarray"> -<span id="pygame-sndarray"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.sndarray</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for accessing sound sample data</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="35%" /> -<col width="1%" /> -<col width="64%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="sndarray.html#pygame.sndarray.array">pygame.sndarray.array</a></td> -<td>—</td> -<td>copy Sound samples into an array</td> -</tr> -<tr><td><a class="toc reference external" href="sndarray.html#pygame.sndarray.samples">pygame.sndarray.samples</a></td> -<td>—</td> -<td>reference Sound samples into an array</td> -</tr> -<tr><td><a class="toc reference external" href="sndarray.html#pygame.sndarray.make_sound">pygame.sndarray.make_sound</a></td> -<td>—</td> -<td>convert an array into a Sound object</td> -</tr> -<tr><td><a class="toc reference external" href="sndarray.html#pygame.sndarray.use_arraytype">pygame.sndarray.use_arraytype</a></td> -<td>—</td> -<td>Sets the array system to be used for sound arrays</td> -</tr> -<tr><td><a class="toc reference external" href="sndarray.html#pygame.sndarray.get_arraytype">pygame.sndarray.get_arraytype</a></td> -<td>—</td> -<td>Gets the currently active array type.</td> -</tr> -<tr><td><a class="toc reference external" href="sndarray.html#pygame.sndarray.get_arraytypes">pygame.sndarray.get_arraytypes</a></td> -<td>—</td> -<td>Gets the array system types currently supported.</td> -</tr> -</tbody> -</table> -<p>Functions to convert between Numeric or numpy arrays and Sound objects. This -module will only be available when pygame can use the external numpy or Numeric -package.</p> -<p>Sound data is made of thousands of samples per second, and each sample is the -amplitude of the wave at a particular moment in time. For example, in 22-kHz -format, element number 5 of the array is the amplitude of the wave after -5/22000 seconds.</p> -<p>Each sample is an 8-bit or 16-bit integer, depending on the data format. A -stereo sound file has two values per sample, while a mono sound file only has -one.</p> -<p>Supported array systems are</p> -<div class="highlight-python"><pre>numpy -numeric (deprecated; to be removed in Pygame 1.9.3.)</pre> -</div> -<p>The default will be numpy, if installed. Otherwise, Numeric will be set as -default if installed, and a deprecation warning will be issued. If neither -numpy nor Numeric are installed, the module will raise an ImportError.</p> -<p>The array type to use can be changed at runtime using the <tt class="docutils literal"><span class="pre">use_arraytype()</span></tt> -method, which requires one of the above types as string.</p> -<p>Note: numpy and Numeric are not completely compatible. Certain array -manipulations, which work for one type, might behave differently or even -completely break for the other.</p> -<p>Additionally, in contrast to Numeric numpy can use unsigned 16-bit integers. -Sounds with 16-bit data will be treated as unsigned integers, if the sound -sample type requests this. Numeric instead always uses signed integers for the -representation, which is important to keep in mind, if you use the module’s -functions and wonder about the values.</p> -<p>numpy support added in Pygame 1.8 Official Numeric deprecation begins in Pygame -1.9.2.</p> -<dl class="definition function"> -<dt class="title" id="pygame.sndarray.array"> -<tt class="descclassname">pygame.sndarray.</tt><tt class="descname">array</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sndarray.array" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">copy Sound samples into an array</span></div> -<div class="line"><span class="signature">array(Sound) -> array</span></div> -</div> -<p>Creates a new array for the sound data and copies the samples. The array -will always be in the format returned from <tt class="docutils literal"><span class="pre">pygame.mixer.get_init()</span></tt>.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sndarray.samples"> -<tt class="descclassname">pygame.sndarray.</tt><tt class="descname">samples</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sndarray.samples" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">reference Sound samples into an array</span></div> -<div class="line"><span class="signature">samples(Sound) -> array</span></div> -</div> -<p>Creates a new array that directly references the samples in a Sound object. -Modifying the array will change the Sound. The array will always be in the -format returned from <tt class="docutils literal"><span class="pre">pygame.mixer.get_init()</span></tt>.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sndarray.make_sound"> -<tt class="descclassname">pygame.sndarray.</tt><tt class="descname">make_sound</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sndarray.make_sound" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">convert an array into a Sound object</span></div> -<div class="line"><span class="signature">make_sound(array) -> Sound</span></div> -</div> -<p>Create a new playable Sound object from an array. The mixer module must be -initialized and the array format must be similar to the mixer audio format.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sndarray.use_arraytype"> -<tt class="descclassname">pygame.sndarray.</tt><tt class="descname">use_arraytype</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sndarray.use_arraytype" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets the array system to be used for sound arrays</span></div> -<div class="line"><span class="signature">use_arraytype (arraytype) -> None</span></div> -</div> -<p>Uses the requested array type for the module functions. Currently supported -array types are:</p> -<div class="highlight-python"><pre>numeric (deprecated; will be removed in Pygame 1.9.3.) -numpy</pre> -</div> -<p>If the requested type is not available, a ValueError will be raised.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sndarray.get_arraytype"> -<tt class="descclassname">pygame.sndarray.</tt><tt class="descname">get_arraytype</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sndarray.get_arraytype" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the currently active array type.</span></div> -<div class="line"><span class="signature">get_arraytype () -> str</span></div> -</div> -<p>Returns the currently active array type. This will be a value of the -<tt class="docutils literal"><span class="pre">get_arraytypes()</span></tt> tuple and indicates which type of array module is used -for the array creation.</p> -<p>New in pygame 1.8</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sndarray.get_arraytypes"> -<tt class="descclassname">pygame.sndarray.</tt><tt class="descname">get_arraytypes</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sndarray.get_arraytypes" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the array system types currently supported.</span></div> -<div class="line"><span class="signature">get_arraytypes () -> tuple</span></div> -</div> -<p>Checks, which array systems are available and returns them as a tuple of -strings. The values of the tuple can be used directly in the -<a class="tooltip reference internal" href="#pygame.sndarray.use_arraytype" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.sndarray.use_arraytype()</span></tt><span class="tooltip-content">Sets the array system to be used for sound arrays</span></a> () method. If no supported array -system could be found, None will be returned.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="sprite.html" title="pygame.sprite" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="scrap.html" title="pygame.scrap" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/sprite.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1205 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.sprite — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.Surface" href="surface.html" /> - <link rel="prev" title="pygame.sndarray" href="sndarray.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.sprite"> -<span id="pygame-sprite"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.sprite</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module with basic game object classes</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="30%" /> -<col width="1%" /> -<col width="69%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Sprite">pygame.sprite.Sprite</a></td> -<td>—</td> -<td>simple base class for visible game objects</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.DirtySprite">pygame.sprite.DirtySprite</a></td> -<td>—</td> -<td>a more featureful subclass of Sprite with more attributes</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group">pygame.sprite.Group</a></td> -<td>—</td> -<td>container class for many Sprites</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.RenderPlain">pygame.sprite.RenderPlain</a></td> -<td>—</td> -<td></td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.RenderClear">pygame.sprite.RenderClear</a></td> -<td>—</td> -<td></td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.RenderUpdates">pygame.sprite.RenderUpdates</a></td> -<td>—</td> -<td>Group class that tracks dirty updates</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.OrderedUpdates">pygame.sprite.OrderedUpdates</a></td> -<td>—</td> -<td>RenderUpdates class that draws Sprites in order of addition</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates">pygame.sprite.LayeredUpdates</a></td> -<td>—</td> -<td>LayeredUpdates Group handles layers, that draws like OrderedUpdates.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty">pygame.sprite.LayeredDirty</a></td> -<td>—</td> -<td>LayeredDirty Group is for DirtySprites. Subclasses LayeredUpdates.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.GroupSingle">pygame.sprite.GroupSingle</a></td> -<td>—</td> -<td>Group container that holds a single Sprite</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.spritecollide">pygame.sprite.spritecollide</a></td> -<td>—</td> -<td>find Sprites in a Group that intersect another Sprite</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.collide_rect">pygame.sprite.collide_rect</a></td> -<td>—</td> -<td>collision detection between two sprites, using rects.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.collide_rect_ratio">pygame.sprite.collide_rect_ratio</a></td> -<td>—</td> -<td>collision detection between two sprites, using rects scaled to a ratio.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.collide_circle">pygame.sprite.collide_circle</a></td> -<td>—</td> -<td>collision detection between two sprites, using circles.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.collide_circle_ratio">pygame.sprite.collide_circle_ratio</a></td> -<td>—</td> -<td>collision detection between two sprites, using circles scaled to a ratio.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.collide_mask">pygame.sprite.collide_mask</a></td> -<td>—</td> -<td>collision detection between two sprites, using masks.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.groupcollide">pygame.sprite.groupcollide</a></td> -<td>—</td> -<td>find all Sprites that collide between two Groups</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.spritecollideany">pygame.sprite.spritecollideany</a></td> -<td>—</td> -<td>simple test if a Sprite intersects anything in a Group</td> -</tr> -</tbody> -</table> -<p>This module contains several simple classes to be used within games. There is -the main Sprite class and several Group classes that contain Sprites. The use -of these classes is entirely optional when using Pygame. The classes are fairly -lightweight and only provide a starting place for the code that is common to -most games.</p> -<p>The Sprite class is intended to be used as a base class for the different types -of objects in the game. There is also a base Group class that simply stores -sprites. A game could create new types of Group classes that operate on -specially customized Sprite instances they contain.</p> -<p>The basic Sprite class can draw the Sprites it contains to a Surface. The -<tt class="docutils literal"><span class="pre">Group.draw()</span></tt> method requires that each Sprite have a <tt class="docutils literal"><span class="pre">Surface.image</span></tt> -attribute and a <tt class="docutils literal"><span class="pre">Surface.rect</span></tt>. The <tt class="docutils literal"><span class="pre">Group.clear()</span></tt> method requires these -same attributes, and can be used to erase all the Sprites with background. -There are also more advanced Groups: <tt class="docutils literal"><span class="pre">pygame.sprite.RenderUpdates()</span></tt> and -<tt class="docutils literal"><span class="pre">pygame.sprite.OrderedUpdates()</span></tt>.</p> -<p>Lastly, this module contains several collision functions. These help find -sprites inside multiple groups that have intersecting bounding rectangles. To -find the collisions, the Sprites are required to have a <tt class="docutils literal"><span class="pre">Surface.rect</span></tt> -attribute assigned.</p> -<p>The groups are designed for high efficiency in removing and adding Sprites to -them. They also allow cheap testing to see if a Sprite already exists in a -Group. A given Sprite can exist in any number of groups. A game could use some -groups to control object rendering, and a completely separate set of groups to -control interaction or player movement. Instead of adding type attributes or -bools to a derived Sprite class, consider keeping the Sprites inside organized -Groups. This will allow for easier lookup later in the game.</p> -<p>Sprites and Groups manage their relationships with the <tt class="docutils literal"><span class="pre">add()</span></tt> and -<tt class="docutils literal"><span class="pre">remove()</span></tt> methods. These methods can accept a single or multiple targets for -membership. The default initializers for these classes also takes a single or -list of targets for initial membership. It is safe to repeatedly add and remove -the same Sprite from a Group.</p> -<p>While it is possible to design sprite and group classes that don’t derive from -the Sprite and AbstractGroup classes below, it is strongly recommended that you -extend those when you add a Sprite or Group class.</p> -<p>Sprites are not thread safe. So lock them yourself if using threads.</p> -<dl class="definition class"> -<dt class="title" id="pygame.sprite.Sprite"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">Sprite</tt><a class="headerlink" href="#pygame.sprite.Sprite" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">simple base class for visible game objects</span></div> -<div class="line"><span class="signature">Sprite(*groups) -> Sprite</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="37%" /> -<col width="1%" /> -<col width="62%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Sprite.update">pygame.sprite.Sprite.update</a></td> -<td>—</td> -<td>method to control sprite behavior</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Sprite.add">pygame.sprite.Sprite.add</a></td> -<td>—</td> -<td>add the sprite to groups</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Sprite.remove">pygame.sprite.Sprite.remove</a></td> -<td>—</td> -<td>remove the sprite from groups</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Sprite.kill">pygame.sprite.Sprite.kill</a></td> -<td>—</td> -<td>remove the Sprite from all Groups</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Sprite.alive">pygame.sprite.Sprite.alive</a></td> -<td>—</td> -<td>does the sprite belong to any groups</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Sprite.groups">pygame.sprite.Sprite.groups</a></td> -<td>—</td> -<td>list of Groups that contain this Sprite</td> -</tr> -</tbody> -</table> -<p>The base class for visible game objects. Derived classes will want to -override the <tt class="docutils literal"><span class="pre">Sprite.update()</span></tt> and assign a <tt class="docutils literal"><span class="pre">Sprite.image</span></tt> and -<tt class="docutils literal"><span class="pre">Sprite.rect</span></tt> attributes. The initializer can accept any number of Group -instances to be added to.</p> -<p>When subclassing the Sprite, be sure to call the base initializer before -adding the Sprite to Groups.</p> -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Sprite.update"> -<tt class="descname">update</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Sprite.update" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">method to control sprite behavior</span></div> -<div class="line"><span class="signature">update(*args) -> None</span></div> -</div> -<p>The default implementation of this method does nothing; it’s just a -convenient “hook” that you can override. This method is called by -<tt class="docutils literal"><span class="pre">Group.update()</span></tt> with whatever arguments you give it.</p> -<p>There is no need to use this method if not using the convenience method -by the same name in the Group class.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Sprite.add"> -<tt class="descname">add</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Sprite.add" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">add the sprite to groups</span></div> -<div class="line"><span class="signature">add(*groups) -> None</span></div> -</div> -<p>Any number of Group instances can be passed as arguments. The Sprite will -be added to the Groups it is not already a member of.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Sprite.remove"> -<tt class="descname">remove</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Sprite.remove" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">remove the sprite from groups</span></div> -<div class="line"><span class="signature">remove(*groups) -> None</span></div> -</div> -<p>Any number of Group instances can be passed as arguments. The Sprite will -be removed from the Groups it is currently a member of.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Sprite.kill"> -<tt class="descname">kill</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Sprite.kill" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">remove the Sprite from all Groups</span></div> -<div class="line"><span class="signature">kill() -> None</span></div> -</div> -<p>The Sprite is removed from all the Groups that contain it. This won’t -change anything about the state of the Sprite. It is possible to continue -to use the Sprite after this method has been called, including adding it -to Groups.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Sprite.alive"> -<tt class="descname">alive</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Sprite.alive" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">does the sprite belong to any groups</span></div> -<div class="line"><span class="signature">alive() -> bool</span></div> -</div> -<p>Returns True when the Sprite belongs to one or more Groups.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Sprite.groups"> -<tt class="descname">groups</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Sprite.groups" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">list of Groups that contain this Sprite</span></div> -<div class="line"><span class="signature">groups() -> group_list</span></div> -</div> -<p>Return a list of all the Groups that contain this Sprite.</p> -</dd></dl> - -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.sprite.DirtySprite"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">DirtySprite</tt><a class="headerlink" href="#pygame.sprite.DirtySprite" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">a more featureful subclass of Sprite with more attributes</span></div> -<div class="line"><span class="signature">DirtySprite(*groups) -> DirtySprite</span></div> -</div> -<p>Extra DirtySprite attributes with their default values:</p> -<p>dirty = 1</p> -<div class="highlight-python"><pre>if set to 1, it is repainted and then set to 0 again -if set to 2 then it is always dirty ( repainted each frame, -flag is not reset) -0 means that it is not dirty and therefor not repainted again</pre> -</div> -<p>blendmode = 0</p> -<div class="highlight-python"><pre>its the special_flags argument of blit, blendmodes</pre> -</div> -<p>source_rect = None</p> -<div class="highlight-python"><pre>source rect to use, remember that it is relative to -topleft (0,0) of self.image</pre> -</div> -<p>visible = 1</p> -<div class="highlight-python"><pre>normally 1, if set to 0 it will not be repainted -(you must set it dirty too to be erased from screen)</pre> -</div> -<p>layer = 0</p> -<div class="highlight-python"><pre>(READONLY value, it is read when adding it to the -LayeredDirty, for details see doc of LayeredDirty)</pre> -</div> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.sprite.Group"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">Group</tt><a class="headerlink" href="#pygame.sprite.Group" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">container class for many Sprites</span></div> -<div class="line"><span class="signature">Group(*sprites) -> Group</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="35%" /> -<col width="1%" /> -<col width="64%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.sprites">pygame.sprite.Group.sprites</a></td> -<td>—</td> -<td>list of the Sprites this Group contains</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.copy">pygame.sprite.Group.copy</a></td> -<td>—</td> -<td>duplicate the Group</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.add">pygame.sprite.Group.add</a></td> -<td>—</td> -<td>add Sprites to this Group</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.remove">pygame.sprite.Group.remove</a></td> -<td>—</td> -<td>remove Sprites from the Group</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.has">pygame.sprite.Group.has</a></td> -<td>—</td> -<td>test if a Group contains Sprites</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.update">pygame.sprite.Group.update</a></td> -<td>—</td> -<td>call the update method on contained Sprites</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.draw">pygame.sprite.Group.draw</a></td> -<td>—</td> -<td>blit the Sprite images</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.clear">pygame.sprite.Group.clear</a></td> -<td>—</td> -<td>draw a background over the Sprites</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.Group.empty">pygame.sprite.Group.empty</a></td> -<td>—</td> -<td>remove all Sprites</td> -</tr> -</tbody> -</table> -<p>A simple container for Sprite objects. This class can be inherited to create -containers with more specific behaviors. The constructor takes any number of -Sprite arguments to add to the Group. The group supports the following -standard Python operations:</p> -<div class="highlight-python"><pre>in test if a Sprite is contained -len the number of Sprites contained -bool test if any Sprites are contained -iter iterate through all the Sprites</pre> -</div> -<p>The Sprites in the Group are not ordered, so drawing and iterating the -Sprites is in no particular order.</p> -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.sprites"> -<tt class="descname">sprites</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.sprites" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">list of the Sprites this Group contains</span></div> -<div class="line"><span class="signature">sprites() -> sprite_list</span></div> -</div> -<p>Return a list of all the Sprites this group contains. You can also get an -iterator from the group, but you cannot iterator over a Group while -modifying it.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.copy"> -<tt class="descname">copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.copy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">duplicate the Group</span></div> -<div class="line"><span class="signature">copy() -> Group</span></div> -</div> -<p>Creates a new Group with all the same Sprites as the original. If you -have subclassed Group, the new object will have the same (sub-)class as -the original. This only works if the derived class’s constructor takes -the same arguments as the Group class’s.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.add"> -<tt class="descname">add</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.add" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">add Sprites to this Group</span></div> -<div class="line"><span class="signature">add(*sprites) -> None</span></div> -</div> -<p>Add any number of Sprites to this Group. This will only add Sprites that -are not already members of the Group.</p> -<p>Each sprite argument can also be a iterator containing Sprites.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.remove"> -<tt class="descname">remove</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.remove" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">remove Sprites from the Group</span></div> -<div class="line"><span class="signature">remove(*sprites) -> None</span></div> -</div> -<p>Remove any number of Sprites from the Group. This will only remove -Sprites that are already members of the Group.</p> -<p>Each sprite argument can also be a iterator containing Sprites.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.has"> -<tt class="descname">has</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.has" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if a Group contains Sprites</span></div> -<div class="line"><span class="signature">has(*sprites) -> None</span></div> -</div> -<p>Return True if the Group contains all of the given sprites. This is -similar to using the “in” operator on the Group (“if sprite in group: -...”), which tests if a single Sprite belongs to a Group.</p> -<p>Each sprite argument can also be a iterator containing Sprites.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.update"> -<tt class="descname">update</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.update" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">call the update method on contained Sprites</span></div> -<div class="line"><span class="signature">update(*args) -> None</span></div> -</div> -<p>Calls the <tt class="docutils literal"><span class="pre">update()</span></tt> method on all Sprites in the Group. The base -Sprite class has an update method that takes any number of arguments and -does nothing. The arguments passed to <tt class="docutils literal"><span class="pre">Group.update()</span></tt> will be passed -to each Sprite.</p> -<p>There is no way to get the return value from the <tt class="docutils literal"><span class="pre">Sprite.update()</span></tt> -methods.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.draw"> -<tt class="descname">draw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.draw" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">blit the Sprite images</span></div> -<div class="line"><span class="signature">draw(Surface) -> None</span></div> -</div> -<p>Draws the contained Sprites to the Surface argument. This uses the -<tt class="docutils literal"><span class="pre">Sprite.image</span></tt> attribute for the source surface, and <tt class="docutils literal"><span class="pre">Sprite.rect</span></tt> -for the position.</p> -<p>The Group does not keep sprites in any order, so the draw order is -arbitrary.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.clear"> -<tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.clear" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw a background over the Sprites</span></div> -<div class="line"><span class="signature">clear(Surface_dest, background) -> None</span></div> -</div> -<p>Erases the Sprites used in the last <tt class="docutils literal"><span class="pre">Group.draw()</span></tt> call. The -destination Surface is cleared by filling the drawn Sprite positions with -the background.</p> -<p>The background is usually a Surface image the same dimensions as the -destination Surface. However, it can also be a callback function that -takes two arguments; the destination Surface and an area to clear. The -background callback function will be called several times each clear.</p> -<p>Here is an example callback that will clear the Sprites with solid red:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">clear_callback</span><span class="p">(</span><span class="n">surf</span><span class="p">,</span> <span class="n">rect</span><span class="p">):</span> - <span class="n">color</span> <span class="o">=</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span> - <span class="n">surf</span><span class="o">.</span><span class="n">fill</span><span class="p">(</span><span class="n">color</span><span class="p">,</span> <span class="n">rect</span><span class="p">)</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.Group.empty"> -<tt class="descname">empty</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.Group.empty" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">remove all Sprites</span></div> -<div class="line"><span class="signature">empty() -> None</span></div> -</div> -<p>Removes all Sprites from this Group.</p> -</dd></dl> - -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.sprite.RenderPlain"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">RenderPlain</tt><a class="headerlink" href="#pygame.sprite.RenderPlain" title="Permalink to this definition">¶</a></dt> -<dd><p>same as pygame.sprite.Group</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.sprite.RenderClear"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">RenderClear</tt><a class="headerlink" href="#pygame.sprite.RenderClear" title="Permalink to this definition">¶</a></dt> -<dd><p>same as pygame.sprite.Group</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.sprite.RenderUpdates"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">RenderUpdates</tt><a class="headerlink" href="#pygame.sprite.RenderUpdates" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Group class that tracks dirty updates</span></div> -<div class="line"><span class="signature">RenderUpdates(*sprites) -> RenderUpdates</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="37%" /> -<col width="1%" /> -<col width="62%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.RenderUpdates.draw">pygame.sprite.RenderUpdates.draw</a></td> -<td>—</td> -<td>blit the Sprite images and track changed areas</td> -</tr> -</tbody> -</table> -<p>This class is derived from <tt class="docutils literal"><span class="pre">pygame.sprite.Group()</span></tt>. It has an extended -<tt class="docutils literal"><span class="pre">draw()</span></tt> method that tracks the changed areas of the screen.</p> -<dl class="definition method"> -<dt class="title" id="pygame.sprite.RenderUpdates.draw"> -<tt class="descname">draw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.RenderUpdates.draw" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">blit the Sprite images and track changed areas</span></div> -<div class="line"><span class="signature">draw(surface) -> Rect_list</span></div> -</div> -<p>Draws all the Sprites to the surface, the same as <tt class="docutils literal"><span class="pre">Group.draw()</span></tt>. This -method also returns a list of Rectangular areas on the screen that have -been changed. The returned changes include areas of the screen that have -been affected by previous <tt class="docutils literal"><span class="pre">Group.clear()</span></tt> calls.</p> -<p>The returned Rect list should be passed to <tt class="docutils literal"><span class="pre">pygame.display.update()</span></tt>. -This will help performance on software driven display modes. This type of -updating is usually only helpful on destinations with non-animating -backgrounds.</p> -</dd></dl> - -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.OrderedUpdates"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">OrderedUpdates</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.OrderedUpdates" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">RenderUpdates class that draws Sprites in order of addition</span></div> -<div class="line"><span class="signature">OrderedUpdates(*spites) -> OrderedUpdates</span></div> -</div> -<p>This class derives from <tt class="docutils literal"><span class="pre">pygame.sprite.RenderUpdates()</span></tt>. It maintains the -order in which the Sprites were added to the Group for rendering. This makes -adding and removing Sprites from the Group a little slower than regular -Groups.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.sprite.LayeredUpdates"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">LayeredUpdates</tt><a class="headerlink" href="#pygame.sprite.LayeredUpdates" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">LayeredUpdates Group handles layers, that draws like OrderedUpdates.</span></div> -<div class="line"><span class="signature">LayeredUpdates(*spites, **kwargs) -> LayeredUpdates</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="42%" /> -<col width="1%" /> -<col width="58%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.add">pygame.sprite.LayeredUpdates.add</a></td> -<td>—</td> -<td>add a sprite or sequence of sprites to a group</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.sprites">pygame.sprite.LayeredUpdates.sprites</a></td> -<td>—</td> -<td>returns a ordered list of sprites (first back, last top).</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.draw">pygame.sprite.LayeredUpdates.draw</a></td> -<td>—</td> -<td>draw all sprites in the right order onto the passed surface.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.get_sprites_at">pygame.sprite.LayeredUpdates.get_sprites_at</a></td> -<td>—</td> -<td>returns a list with all sprites at that position.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.get_sprite">pygame.sprite.LayeredUpdates.get_sprite</a></td> -<td>—</td> -<td>returns the sprite at the index idx from the groups sprites</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.remove_sprites_of_layer">pygame.sprite.LayeredUpdates.remove_sprites_of_layer</a></td> -<td>—</td> -<td>removes all sprites from a layer and returns them as a list.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.layers">pygame.sprite.LayeredUpdates.layers</a></td> -<td>—</td> -<td>returns a list of layers defined (unique), sorted from botton up.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.change_layer">pygame.sprite.LayeredUpdates.change_layer</a></td> -<td>—</td> -<td>changes the layer of the sprite</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.get_layer_of_sprite">pygame.sprite.LayeredUpdates.get_layer_of_sprite</a></td> -<td>—</td> -<td>returns the layer that sprite is currently in.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.get_top_layer">pygame.sprite.LayeredUpdates.get_top_layer</a></td> -<td>—</td> -<td>returns the top layer</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.get_bottom_layer">pygame.sprite.LayeredUpdates.get_bottom_layer</a></td> -<td>—</td> -<td>returns the bottom layer</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.move_to_front">pygame.sprite.LayeredUpdates.move_to_front</a></td> -<td>—</td> -<td>brings the sprite to front layer</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.move_to_back">pygame.sprite.LayeredUpdates.move_to_back</a></td> -<td>—</td> -<td>moves the sprite to the bottom layer</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.get_top_sprite">pygame.sprite.LayeredUpdates.get_top_sprite</a></td> -<td>—</td> -<td>returns the topmost sprite</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.get_sprites_from_layer">pygame.sprite.LayeredUpdates.get_sprites_from_layer</a></td> -<td>—</td> -<td>returns all sprites from a layer, ordered by how they where added</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredUpdates.switch_layer">pygame.sprite.LayeredUpdates.switch_layer</a></td> -<td>—</td> -<td>switches the sprites from layer1 to layer2</td> -</tr> -</tbody> -</table> -<p>This group is fully compatible with <a class="tooltip reference internal" href="#pygame.sprite.Sprite" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.sprite.Sprite</span></tt><span class="tooltip-content">simple base class for visible game objects</span></a>.</p> -<p>You can set the default layer through kwargs using ‘default_layer’ and an -integer for the layer. The default layer is 0.</p> -<p>If the sprite you add has an attribute layer then that layer will be used. -If the **kwarg contains ‘layer’ then the sprites passed will be added to -that layer (overriding the <tt class="docutils literal"><span class="pre">sprite.layer</span></tt> attribute). If neither sprite -has attribute layer nor **kwarg then the default layer is used to add the -sprites.</p> -<p>New in pygame 1.8.0</p> -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.add"> -<tt class="descname">add</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.add" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">add a sprite or sequence of sprites to a group</span></div> -<div class="line"><span class="signature">add(*sprites, **kwargs) -> None</span></div> -</div> -<p>If the <tt class="docutils literal"><span class="pre">sprite(s)</span></tt> have an attribute layer then that is used for the -layer. If **kwargs contains ‘layer’ then the <tt class="docutils literal"><span class="pre">sprite(s)</span></tt> will be added -to that argument (overriding the sprite layer attribute). If neither is -passed then the <tt class="docutils literal"><span class="pre">sprite(s)</span></tt> will be added to the default layer.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.sprites"> -<tt class="descname">sprites</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.sprites" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a ordered list of sprites (first back, last top).</span></div> -<div class="line"><span class="signature">sprites() -> sprites</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.draw"> -<tt class="descname">draw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.draw" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw all sprites in the right order onto the passed surface.</span></div> -<div class="line"><span class="signature">draw(surface) -> Rect_list</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.get_sprites_at"> -<tt class="descname">get_sprites_at</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.get_sprites_at" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a list with all sprites at that position.</span></div> -<div class="line"><span class="signature">get_sprites_at(pos) -> colliding_sprites</span></div> -</div> -<p>Bottom sprites first, top last.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.get_sprite"> -<tt class="descname">get_sprite</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.get_sprite" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the sprite at the index idx from the groups sprites</span></div> -<div class="line"><span class="signature">get_sprite(idx) -> sprite</span></div> -</div> -<p>Raises IndexOutOfBounds if the idx is not within range.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.remove_sprites_of_layer"> -<tt class="descname">remove_sprites_of_layer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.remove_sprites_of_layer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">removes all sprites from a layer and returns them as a list.</span></div> -<div class="line"><span class="signature">remove_sprites_of_layer(layer_nr) -> sprites</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.layers"> -<tt class="descname">layers</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.layers" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns a list of layers defined (unique), sorted from botton up.</span></div> -<div class="line"><span class="signature">layers() -> layers</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.change_layer"> -<tt class="descname">change_layer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.change_layer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">changes the layer of the sprite</span></div> -<div class="line"><span class="signature">change_layer(sprite, new_layer) -> None</span></div> -</div> -<p>sprite must have been added to the renderer. It is not checked.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.get_layer_of_sprite"> -<tt class="descname">get_layer_of_sprite</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.get_layer_of_sprite" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the layer that sprite is currently in.</span></div> -<div class="line"><span class="signature">get_layer_of_sprite(sprite) -> layer</span></div> -</div> -<p>If the sprite is not found then it will return the default layer.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.get_top_layer"> -<tt class="descname">get_top_layer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.get_top_layer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the top layer</span></div> -<div class="line"><span class="signature">get_top_layer() -> layer</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.get_bottom_layer"> -<tt class="descname">get_bottom_layer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.get_bottom_layer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the bottom layer</span></div> -<div class="line"><span class="signature">get_bottom_layer() -> layer</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.move_to_front"> -<tt class="descname">move_to_front</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.move_to_front" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">brings the sprite to front layer</span></div> -<div class="line"><span class="signature">move_to_front(sprite) -> None</span></div> -</div> -<p>Brings the sprite to front, changing sprite layer to topmost layer (added -at the end of that layer).</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.move_to_back"> -<tt class="descname">move_to_back</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.move_to_back" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">moves the sprite to the bottom layer</span></div> -<div class="line"><span class="signature">move_to_back(sprite) -> None</span></div> -</div> -<p>Moves the sprite to the bottom layer, moving it behind all other layers -and adding one additional layer.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.get_top_sprite"> -<tt class="descname">get_top_sprite</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.get_top_sprite" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns the topmost sprite</span></div> -<div class="line"><span class="signature">get_top_sprite() -> Sprite</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.get_sprites_from_layer"> -<tt class="descname">get_sprites_from_layer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.get_sprites_from_layer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">returns all sprites from a layer, ordered by how they where added</span></div> -<div class="line"><span class="signature">get_sprites_from_layer(layer) -> sprites</span></div> -</div> -<p>Returns all sprites from a layer, ordered by how they where added. It -uses linear search and the sprites are not removed from layer.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredUpdates.switch_layer"> -<tt class="descname">switch_layer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredUpdates.switch_layer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">switches the sprites from layer1 to layer2</span></div> -<div class="line"><span class="signature">switch_layer(layer1_nr, layer2_nr) -> None</span></div> -</div> -<p>The layers number must exist, it is not checked.</p> -</dd></dl> - -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.sprite.LayeredDirty"> -<em class="property">class </em><tt class="descclassname">pygame.sprite.</tt><tt class="descname">LayeredDirty</tt><a class="headerlink" href="#pygame.sprite.LayeredDirty" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">LayeredDirty Group is for DirtySprites. Subclasses LayeredUpdates.</span></div> -<div class="line"><span class="signature">LayeredDirty(*spites, **kwargs) -> LayeredDirty</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="37%" /> -<col width="1%" /> -<col width="62%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty.draw">pygame.sprite.LayeredDirty.draw</a></td> -<td>—</td> -<td>draw all sprites in the right order onto the passed surface.</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty.clear">pygame.sprite.LayeredDirty.clear</a></td> -<td>—</td> -<td>used to set background</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty.repaint_rect">pygame.sprite.LayeredDirty.repaint_rect</a></td> -<td>—</td> -<td>repaints the given area</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty.set_clip">pygame.sprite.LayeredDirty.set_clip</a></td> -<td>—</td> -<td>clip the area where to draw. Just pass None (default) to reset the clip</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty.get_clip">pygame.sprite.LayeredDirty.get_clip</a></td> -<td>—</td> -<td>get the area where drawing will occur</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty.change_layer">pygame.sprite.LayeredDirty.change_layer</a></td> -<td>—</td> -<td>changes the layer of the sprite</td> -</tr> -<tr><td><a class="toc reference external" href="sprite.html#pygame.sprite.LayeredDirty.set_timing_treshold">pygame.sprite.LayeredDirty.set_timing_treshold</a></td> -<td>—</td> -<td>sets the treshold in milliseconds</td> -</tr> -</tbody> -</table> -<p>This group requires <a class="tooltip reference internal" href="#pygame.sprite.DirtySprite" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.sprite.DirtySprite</span></tt><span class="tooltip-content">a more featureful subclass of Sprite with more attributes</span></a> or any sprite that -has the following attributes:</p> -<div class="highlight-python"><pre>image, rect, dirty, visible, blendmode (see doc of DirtySprite).</pre> -</div> -<p>It uses the dirty flag technique and is therefore faster than the -<a class="tooltip reference internal" href="#pygame.sprite.RenderUpdates" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.sprite.RenderUpdates</span></tt><span class="tooltip-content">Group class that tracks dirty updates</span></a> if you have many static sprites. It -also switches automatically between dirty rect update and full screen -drawing, so you do no have to worry what would be faster.</p> -<p>Same as for the <a class="tooltip reference internal" href="#pygame.sprite.Group" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.sprite.Group</span></tt><span class="tooltip-content">container class for many Sprites</span></a>. You can specify some -additional attributes through kwargs:</p> -<div class="highlight-python"><pre>_use_update: True/False default is False -_default_layer: default layer where sprites without a layer are added. -_time_threshold: treshold time for switching between dirty rect mode - and fullscreen mode, defaults to 1000./80 == 1000./fps</pre> -</div> -<p>New in pygame 1.8.0</p> -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredDirty.draw"> -<tt class="descname">draw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredDirty.draw" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw all sprites in the right order onto the passed surface.</span></div> -<div class="line"><span class="signature">draw(surface, bgd=None) -> Rect_list</span></div> -</div> -<p>You can pass the background too. If a background is already set, then the -bgd argument has no effect.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredDirty.clear"> -<tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredDirty.clear" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">used to set background</span></div> -<div class="line"><span class="signature">clear(surface, bgd) -> None</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredDirty.repaint_rect"> -<tt class="descname">repaint_rect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredDirty.repaint_rect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">repaints the given area</span></div> -<div class="line"><span class="signature">repaint_rect(screen_rect) -> None</span></div> -</div> -<p>screen_rect is in screencoordinates. This method does not do any drawing by itself; the area specified by the rect attributes will be redrawn when the draw method is called.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredDirty.set_clip"> -<tt class="descname">set_clip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredDirty.set_clip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">clip the area where to draw. Just pass None (default) to reset the clip</span></div> -<div class="line"><span class="signature">set_clip(screen_rect=None) -> None</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredDirty.get_clip"> -<tt class="descname">get_clip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredDirty.get_clip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the area where drawing will occur</span></div> -<div class="line"><span class="signature">get_clip() -> Rect</span></div> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredDirty.change_layer"> -<tt class="descname">change_layer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredDirty.change_layer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">changes the layer of the sprite</span></div> -<div class="line"><span class="signature">change_layer(sprite, new_layer) -> None</span></div> -</div> -<p>sprite must have been added to the renderer. It is not checked.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.sprite.LayeredDirty.set_timing_treshold"> -<tt class="descname">set_timing_treshold</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.LayeredDirty.set_timing_treshold" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">sets the treshold in milliseconds</span></div> -<div class="line"><span class="signature">set_timing_treshold(time_ms) -> None</span></div> -</div> -<p>Default is 1000./80 where 80 is the fps I want to switch to full screen -mode.</p> -</dd></dl> - -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.GroupSingle"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">GroupSingle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.GroupSingle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Group container that holds a single Sprite</span></div> -<div class="line"><span class="signature">GroupSingle(sprite=None) -> GroupSingle</span></div> -</div> -<p>The GroupSingle container only holds a single Sprite. When a new Sprite is -added, the old one is removed.</p> -<p>There is a special property, <tt class="docutils literal"><span class="pre">GroupSingle.sprite</span></tt>, that accesses the -Sprite that this Group contains. It can be None when the Group is empty. The -property can also be assigned to add a Sprite into the GroupSingle -container.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.spritecollide"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">spritecollide</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.spritecollide" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find Sprites in a Group that intersect another Sprite</span></div> -<div class="line"><span class="signature">spritecollide(sprite, group, dokill, collided = None) -> Sprite_list</span></div> -</div> -<p>Return a list containing all Sprites in a Group that intersect with another -Sprite. Intersection is determined by comparing the <tt class="docutils literal"><span class="pre">Sprite.rect</span></tt> -attribute of each Sprite.</p> -<p>The dokill argument is a bool. If set to True, all Sprites that collide will -be removed from the Group.</p> -<p>The collided argument is a callback function used to calculate if two -sprites are colliding. it should take two sprites as values, and return a -bool value indicating if they are colliding. If collided is not passed, all -sprites must have a “rect” value, which is a rectangle of the sprite area, -which will be used to calculate the collision.</p> -<p>collided callables:</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">collide_rect</span><span class="p">,</span> <span class="n">collide_rect_ratio</span><span class="p">,</span> <span class="n">collide_circle</span><span class="p">,</span> -<span class="n">collide_circle_ratio</span><span class="p">,</span> <span class="n">collide_mask</span> -</pre></div> -</div> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.collide_rect"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">collide_rect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.collide_rect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">collision detection between two sprites, using rects.</span></div> -<div class="line"><span class="signature">collide_rect(left, right) -> bool</span></div> -</div> -<p>Tests for collision between two sprites. Uses the pygame rect colliderect -function to calculate the collision. Intended to be passed as a collided -callback function to the *collide functions. Sprites must have a “rect” -attributes.</p> -<p>New in pygame 1.8.0</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.collide_rect_ratio"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">collide_rect_ratio</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.collide_rect_ratio" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">collision detection between two sprites, using rects scaled to a ratio.</span></div> -<div class="line"><span class="signature">collide_rect_ratio(ratio) -> collided_callable</span></div> -</div> -<p>A callable class that checks for collisions between two sprites, using a -scaled version of the sprites rects.</p> -<p>Is created with a ratio, the instance is then intended to be passed as a -collided callback function to the *collide functions.</p> -<p>A ratio is a floating point number - 1.0 is the same size, 2.0 is twice as -big, and 0.5 is half the size.</p> -<p>New in pygame 1.8.1</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.collide_circle"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">collide_circle</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.collide_circle" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">collision detection between two sprites, using circles.</span></div> -<div class="line"><span class="signature">collide_circle(left, right) -> bool</span></div> -</div> -<p>Tests for collision between two sprites, by testing to see if two circles -centered on the sprites overlap. If the sprites have a “radius” attribute, -that is used to create the circle, otherwise a circle is created that is big -enough to completely enclose the sprites rect as given by the “rect” -attribute. Intended to be passed as a collided callback function to the -*collide functions. Sprites must have a “rect” and an optional “radius” -attribute.</p> -<p>New in pygame 1.8.1</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.collide_circle_ratio"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">collide_circle_ratio</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.collide_circle_ratio" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">collision detection between two sprites, using circles scaled to a ratio.</span></div> -<div class="line"><span class="signature">collide_circle_ratio(ratio) -> collided_callable</span></div> -</div> -<p>A callable class that checks for collisions between two sprites, using a -scaled version of the sprites radius.</p> -<p>Is created with a floating point ratio, the instance is then intended to be -passed as a collided callback function to the *collide functions.</p> -<p>A ratio is a floating point number - 1.0 is the same size, 2.0 is twice as -big, and 0.5 is half the size.</p> -<p>The created callable tests for collision between two sprites, by testing to -see if two circles centered on the sprites overlap, after scaling the -circles radius by the stored ratio. If the sprites have a “radius” -attribute, that is used to create the circle, otherwise a circle is created -that is big enough to completely enclose the sprites rect as given by the -“rect” attribute. Intended to be passed as a collided callback function to -the *collide functions. Sprites must have a “rect” and an optional “radius” -attribute.</p> -<p>New in pygame 1.8.1</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.collide_mask"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">collide_mask</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.collide_mask" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">collision detection between two sprites, using masks.</span></div> -<div class="line"><span class="signature">collide_mask(SpriteLeft, SpriteRight) -> point</span></div> -</div> -<p>Returns first point on the mask where the masks collided, or None if -there was no collision.</p> -<p>Tests for collision between two sprites, by testing if thier bitmasks -overlap. If the sprites have a “mask” attribute, that is used as the mask, -otherwise a mask is created from the sprite image. Intended to be passed as -a collided callback function to the *collide functions. Sprites must have a -“rect” and an optional “mask” attribute.</p> -<p>You should consider creating a mask for your sprite at load time if you -are going to check collisions many times. This will increase the -performance, otherwise this can be an expensive function because it -will create the masks each time you check for collisions.</p> -<div class="highlight-python"><div class="highlight"><pre><span class="n">sprite</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">pygame</span><span class="o">.</span><span class="n">mask</span><span class="o">.</span><span class="n">from_surface</span><span class="p">(</span><span class="n">sprite</span><span class="o">.</span><span class="n">image</span><span class="p">)</span> -</pre></div> -</div> -<p>New in pygame 1.8.0</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.groupcollide"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">groupcollide</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.groupcollide" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find all Sprites that collide between two Groups</span></div> -<div class="line"><span class="signature">groupcollide(group1, group2, dokill1, dokill2, collided = None) -> Sprite_dict</span></div> -</div> -<p>This will find collisions between all the Sprites in two groups. -Collision is determined by comparing the <tt class="docutils literal"><span class="pre">Sprite.rect</span></tt> attribute of -each Sprite or by using the collided function if it is not None.</p> -<p>Every Sprite inside group1 is added to the return dictionary. The value for -each item is the list of Sprites in group2 that intersect.</p> -<p>If either dokill argument is True, the colliding Sprites will be removed -from their respective Group.</p> -<p>The collided argument is a callback function used to calculate if two sprites are -colliding. It should take two sprites as values and return a bool value -indicating if they are colliding. If collided is not passed, then all -sprites must have a “rect” value, which is a rectangle of the sprite area, -which will be used to calculate the collision.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.sprite.spritecollideany"> -<tt class="descclassname">pygame.sprite.</tt><tt class="descname">spritecollideany</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.sprite.spritecollideany" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">simple test if a Sprite intersects anything in a Group</span></div> -<div class="line"><span class="signature">spritecollideany(sprite, group, collided = None) -> Sprite</span> Collision with the returned sprite.</div> -<div class="line"><span class="signature">spritecollideany(sprite, group, collided = None) -> None</span> No collision</div> -</div> -<p>If the sprite collides with any single sprite in the group, a single -sprite from the group is returned. On no collision None is returned.</p> -<p>If you don’t need all the features of the <tt class="docutils literal"><span class="pre">pygame.sprite.spritecollide()</span></tt> function, this -function will be a bit quicker.</p> -<p>The collided argument is a callback function used to calculate if two sprites are -colliding. It should take two sprites as values and return a bool value -indicating if they are colliding. If collided is not passed, then all -sprites must have a “rect” value, which is a rectangle of the sprite area, -which will be used to calculate the collision.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="surface.html" title="pygame.Surface" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="sndarray.html" title="pygame.sndarray" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/surface.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1116 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.Surface — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.surfarray" href="surfarray.html" /> - <link rel="prev" title="pygame.sprite" href="sprite.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="pygame-surface"> -<dl class="definition class"> -<dt class="title" id="pygame.Surface"> -<em class="property">class </em><tt class="descclassname">pygame.</tt><tt class="descname">Surface</tt><a class="headerlink" href="#pygame.Surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame object for representing images</span></div> -<div class="line"><span class="signature">Surface((width, height), flags=0, depth=0, masks=None) -> Surface</span></div> -<div class="line"><span class="signature">Surface((width, height), flags=0, Surface) -> Surface</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="28%" /> -<col width="1%" /> -<col width="71%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.blit">pygame.Surface.blit</a></td> -<td>—</td> -<td>draw one image onto another</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.convert">pygame.Surface.convert</a></td> -<td>—</td> -<td>change the pixel format of an image</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.convert_alpha">pygame.Surface.convert_alpha</a></td> -<td>—</td> -<td>change the pixel format of an image including per pixel alphas</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.copy">pygame.Surface.copy</a></td> -<td>—</td> -<td>create a new copy of a Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.fill">pygame.Surface.fill</a></td> -<td>—</td> -<td>fill Surface with a solid color</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.scroll">pygame.Surface.scroll</a></td> -<td>—</td> -<td>Shift the surface image in place</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_colorkey">pygame.Surface.set_colorkey</a></td> -<td>—</td> -<td>Set the transparent colorkey</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_colorkey">pygame.Surface.get_colorkey</a></td> -<td>—</td> -<td>Get the current transparent colorkey</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_alpha">pygame.Surface.set_alpha</a></td> -<td>—</td> -<td>set the alpha value for the full Surface image</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_alpha">pygame.Surface.get_alpha</a></td> -<td>—</td> -<td>get the current Surface transparency value</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.lock">pygame.Surface.lock</a></td> -<td>—</td> -<td>lock the Surface memory for pixel access</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.unlock">pygame.Surface.unlock</a></td> -<td>—</td> -<td>unlock the Surface memory from pixel access</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.mustlock">pygame.Surface.mustlock</a></td> -<td>—</td> -<td>test if the Surface requires locking</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_locked">pygame.Surface.get_locked</a></td> -<td>—</td> -<td>test if the Surface is current locked</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_locks">pygame.Surface.get_locks</a></td> -<td>—</td> -<td>Gets the locks for the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_at">pygame.Surface.get_at</a></td> -<td>—</td> -<td>get the color value at a single pixel</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_at">pygame.Surface.set_at</a></td> -<td>—</td> -<td>set the color value for a single pixel</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_at_mapped">pygame.Surface.get_at_mapped</a></td> -<td>—</td> -<td>get the mapped color value at a single pixel</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_palette">pygame.Surface.get_palette</a></td> -<td>—</td> -<td>get the color index palette for an 8bit Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_palette_at">pygame.Surface.get_palette_at</a></td> -<td>—</td> -<td>get the color for a single entry in a palette</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_palette">pygame.Surface.set_palette</a></td> -<td>—</td> -<td>set the color palette for an 8bit Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_palette_at">pygame.Surface.set_palette_at</a></td> -<td>—</td> -<td>set the color for a single index in an 8bit Surface palette</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.map_rgb">pygame.Surface.map_rgb</a></td> -<td>—</td> -<td>convert a color into a mapped color value</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.unmap_rgb">pygame.Surface.unmap_rgb</a></td> -<td>—</td> -<td>convert a mapped integer color value into a Color</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_clip">pygame.Surface.set_clip</a></td> -<td>—</td> -<td>set the current clipping area of the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_clip">pygame.Surface.get_clip</a></td> -<td>—</td> -<td>get the current clipping area of the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.subsurface">pygame.Surface.subsurface</a></td> -<td>—</td> -<td>create a new surface that references its parent</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_parent">pygame.Surface.get_parent</a></td> -<td>—</td> -<td>find the parent of a subsurface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_abs_parent">pygame.Surface.get_abs_parent</a></td> -<td>—</td> -<td>find the top level parent of a subsurface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_offset">pygame.Surface.get_offset</a></td> -<td>—</td> -<td>find the position of a child subsurface inside a parent</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_abs_offset">pygame.Surface.get_abs_offset</a></td> -<td>—</td> -<td>find the absolute position of a child subsurface inside its top level parent</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_size">pygame.Surface.get_size</a></td> -<td>—</td> -<td>get the dimensions of the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_width">pygame.Surface.get_width</a></td> -<td>—</td> -<td>get the width of the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_height">pygame.Surface.get_height</a></td> -<td>—</td> -<td>get the height of the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_rect">pygame.Surface.get_rect</a></td> -<td>—</td> -<td>get the rectangular area of the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_bitsize">pygame.Surface.get_bitsize</a></td> -<td>—</td> -<td>get the bit depth of the Surface pixel format</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_bytesize">pygame.Surface.get_bytesize</a></td> -<td>—</td> -<td>get the bytes used per Surface pixel</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_flags">pygame.Surface.get_flags</a></td> -<td>—</td> -<td>get the additional flags used for the Surface</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_pitch">pygame.Surface.get_pitch</a></td> -<td>—</td> -<td>get the number of bytes used per Surface row</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_masks">pygame.Surface.get_masks</a></td> -<td>—</td> -<td>the bitmasks needed to convert between a color and a mapped integer</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_masks">pygame.Surface.set_masks</a></td> -<td>—</td> -<td>set the bitmasks needed to convert between a color and a mapped integer</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_shifts">pygame.Surface.get_shifts</a></td> -<td>—</td> -<td>the bit shifts needed to convert between a color and a mapped integer</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.set_shifts">pygame.Surface.set_shifts</a></td> -<td>—</td> -<td>sets the bit shifts needed to convert between a color and a mapped integer</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_losses">pygame.Surface.get_losses</a></td> -<td>—</td> -<td>the significant bits used to convert between a color and a mapped integer</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_bounding_rect">pygame.Surface.get_bounding_rect</a></td> -<td>—</td> -<td>find the smallest rect containing data</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_view">pygame.Surface.get_view</a></td> -<td>—</td> -<td>return a view of a surface’s pixel data.</td> -</tr> -<tr><td><a class="toc reference external" href="surface.html#pygame.Surface.get_buffer">pygame.Surface.get_buffer</a></td> -<td>—</td> -<td>acquires a buffer object for the pixels of the Surface.</td> -</tr> -</tbody> -</table> -<p>A pygame Surface is used to represent any image. The Surface has a fixed -resolution and pixel format. Surfaces with 8bit pixels use a color palette -to map to 24bit color.</p> -<p>Call <tt class="docutils literal"><span class="pre">pygame.Surface()</span></tt> to create a new image object. The Surface will be -cleared to all black. The only required arguments are the sizes. With no -additional arguments, the Surface will be created in a format that best -matches the display Surface.</p> -<p>The pixel format can be controlled by passing the bit depth or an existing -Surface. The flags argument is a bitmask of additional features for the -surface. You can pass any combination of these flags:</p> -<div class="highlight-python"><pre>HWSURFACE, creates the image in video memory -SRCALPHA, the pixel format will include a per-pixel alpha</pre> -</div> -<p>Both flags are only a request, and may not be possible for all displays and -formats.</p> -<p>Advance users can combine a set of bitmasks with a depth value. The masks -are a set of 4 integers representing which bits in a pixel will represent -each color. Normal Surfaces should not require the masks argument.</p> -<p>Surfaces can have many extra attributes like alpha planes, colorkeys, source -rectangle clipping. These functions mainly effect how the Surface is blitted -to other Surfaces. The blit routines will attempt to use hardware -acceleration when possible, otherwise they will use highly optimized -software blitting methods.</p> -<p>There are three types of transparency supported in Pygame: colorkeys, -surface alphas, and pixel alphas. Surface alphas can be mixed with -colorkeys, but an image with per pixel alphas cannot use the other modes. -Colorkey transparency makes a single color value transparent. Any pixels -matching the colorkey will not be drawn. The surface alpha value is a single -value that changes the transparency for the entire image. A surface alpha of -255 is opaque, and a value of 0 is completely transparent.</p> -<p>Per pixel alphas are different because they store a transparency value for -every pixel. This allows for the most precise transparency effects, but it -also the slowest. Per pixel alphas cannot be mixed with surface alpha and -colorkeys.</p> -<p>There is support for pixel access for the Surfaces. Pixel access on hardware -surfaces is slow and not recommended. Pixels can be accessed using the -<tt class="docutils literal"><span class="pre">get_at()</span></tt> and <tt class="docutils literal"><span class="pre">set_at()</span></tt> functions. These methods are fine for simple -access, but will be considerably slow when doing of pixel work with them. If -you plan on doing a lot of pixel level work, it is recommended to use a -<a class="tooltip reference internal" href="pixelarray.html#pygame.PixelArray" title=""><tt class="xref py py-class docutils literal"><span class="pre">pygame.PixelArray</span></tt><span class="tooltip-content">pygame object for direct pixel access of surfaces</span></a>, which gives an array like view of the surface. -For involved mathematical manipulations try the <a class="tooltip reference internal" href="surfarray.html#module-pygame.surfarray" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.surfarray</span></tt><span class="tooltip-content">pygame module for accessing surface pixel data using array interfaces</span></a> -module (It’s quite quick, but requires NumPy.)</p> -<p>Any functions that directly access a surface’s pixel data will need that -surface to be lock()’ed. These functions can <tt class="docutils literal"><span class="pre">lock()</span></tt> and <tt class="docutils literal"><span class="pre">unlock()</span></tt> the -surfaces themselves without assistance. But, if a function will be called -many times, there will be a lot of overhead for multiple locking and -unlocking of the surface. It is best to lock the surface manually before -making the function call many times, and then unlocking when you are -finished. All functions that need a locked surface will say so in their -docs. Remember to leave the Surface locked only while necessary.</p> -<p>Surface pixels are stored internally as a single number that has all the -colors encoded into it. Use the <tt class="docutils literal"><span class="pre">Surface.map_rgb()</span></tt> and -<tt class="docutils literal"><span class="pre">Surface.unmap_rgb()</span></tt> to convert between individual red, green, and blue -values into a packed integer for that Surface.</p> -<p>Surfaces can also reference sections of other Surfaces. These are created -with the <tt class="docutils literal"><span class="pre">Surface.subsurface()</span></tt> method. Any change to either Surface will -effect the other.</p> -<p>Each Surface contains a clipping area. By default the clip area covers the -entire Surface. If it is changed, all drawing operations will only effect -the smaller area.</p> -<dl class="definition method"> -<dt class="title" id="pygame.Surface.blit"> -<tt class="descname">blit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.blit" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">draw one image onto another</span></div> -<div class="line"><span class="signature">blit(source, dest, area=None, special_flags = 0) -> Rect</span></div> -</div> -<p>Draws a source Surface onto this Surface. The draw can be positioned with -the dest argument. Dest can either be pair of coordinates representing -the upper left corner of the source. A Rect can also be passed as the -destination and the topleft corner of the rectangle will be used as the -position for the blit. The size of the destination rectangle does not -effect the blit.</p> -<p>An optional area rectangle can be passed as well. This represents a -smaller portion of the source Surface to draw.</p> -<p>An optional special flags is for passing in new in 1.8.0: <tt class="docutils literal"><span class="pre">BLEND_ADD</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_SUB</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_MULT</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_MIN</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_MAX</span></tt> new in 1.8.1: -<tt class="docutils literal"><span class="pre">BLEND_RGBA_ADD</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGBA_SUB</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGBA_MULT</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_RGBA_MIN</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGBA_MAX</span></tt> <tt class="docutils literal"><span class="pre">BLEND_RGB_ADD</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_RGB_SUB</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGB_MULT</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGB_MIN</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_RGB_MAX</span></tt> With other special blitting flags perhaps added in the -future.</p> -<p>The return rectangle is the area of the affected pixels, excluding any -pixels outside the destination Surface, or outside the clipping area.</p> -<p>Pixel alphas will be ignored when blitting to an 8 bit Surface.</p> -<p>special_flags new in pygame 1.8.</p> -<p>For a surface with colorkey or blanket alpha, a blit to self may give -slightly different colors than a non self-blit.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.convert"> -<tt class="descname">convert</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.convert" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">change the pixel format of an image</span></div> -<div class="line"><span class="signature">convert(Surface) -> Surface</span></div> -<div class="line"><span class="signature">convert(depth, flags=0) -> Surface</span></div> -<div class="line"><span class="signature">convert(masks, flags=0) -> Surface</span></div> -<div class="line"><span class="signature">convert() -> Surface</span></div> -</div> -<p>Creates a new copy of the Surface with the pixel format changed. The new -pixel format can be determined from another existing Surface. Otherwise -depth, flags, and masks arguments can be used, similar to the -<tt class="docutils literal"><span class="pre">pygame.Surface()</span></tt> call.</p> -<p>If no arguments are passed the new Surface will have the same pixel -format as the display Surface. This is always the fastest format for -blitting. It is a good idea to convert all Surfaces before they are -blitted many times.</p> -<p>The converted Surface will have no pixel alphas. They will be stripped if -the original had them. See <tt class="docutils literal"><span class="pre">Surface.convert_alpha()</span></tt> for preserving or -creating per-pixel alphas.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.convert_alpha"> -<tt class="descname">convert_alpha</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.convert_alpha" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">change the pixel format of an image including per pixel alphas</span></div> -<div class="line"><span class="signature">convert_alpha(Surface) -> Surface</span></div> -<div class="line"><span class="signature">convert_alpha() -> Surface</span></div> -</div> -<p>Creates a new copy of the surface with the desired pixel format. The new -surface will be in a format suited for quick blitting to the given format -with per pixel alpha. If no surface is given, the new surface will be -optimized for blitting to the current display.</p> -<p>Unlike the <tt class="docutils literal"><span class="pre">Surface.convert()</span></tt> method, the pixel format for the new -image will not be exactly the same as the requested source, but it will -be optimized for fast alpha blitting to the destination.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.copy"> -<tt class="descname">copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.copy" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create a new copy of a Surface</span></div> -<div class="line"><span class="signature">copy() -> Surface</span></div> -</div> -<p>Makes a duplicate copy of a Surface. The new Surface will have the same -pixel formats, color palettes, and transparency settings as the original.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.fill"> -<tt class="descname">fill</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.fill" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">fill Surface with a solid color</span></div> -<div class="line"><span class="signature">fill(color, rect=None, special_flags=0) -> Rect</span></div> -</div> -<p>Fill the Surface with a solid color. If no rect argument is given the -entire Surface will be filled. The rect argument will limit the fill to a -specific area. The fill will also be contained by the Surface clip area.</p> -<p>The color argument can be either a <tt class="docutils literal"><span class="pre">RGB</span></tt> sequence, a <tt class="docutils literal"><span class="pre">RGBA</span></tt> sequence -or a mapped color index. If using <tt class="docutils literal"><span class="pre">RGBA</span></tt>, the Alpha (A part of -<tt class="docutils literal"><span class="pre">RGBA</span></tt>) is ignored unless the surface uses per pixel alpha (Surface has -the <tt class="docutils literal"><span class="pre">SRCALPHA</span></tt> flag).</p> -<p>An optional special_flags is for passing in new in 1.8.0: <tt class="docutils literal"><span class="pre">BLEND_ADD</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_SUB</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_MULT</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_MIN</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_MAX</span></tt> new in 1.8.1: -<tt class="docutils literal"><span class="pre">BLEND_RGBA_ADD</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGBA_SUB</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGBA_MULT</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_RGBA_MIN</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGBA_MAX</span></tt> <tt class="docutils literal"><span class="pre">BLEND_RGB_ADD</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_RGB_SUB</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGB_MULT</span></tt>, <tt class="docutils literal"><span class="pre">BLEND_RGB_MIN</span></tt>, -<tt class="docutils literal"><span class="pre">BLEND_RGB_MAX</span></tt> With other special blitting flags perhaps added in the -future.</p> -<p>This will return the affected Surface area.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.scroll"> -<tt class="descname">scroll</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.scroll" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Shift the surface image in place</span></div> -<div class="line"><span class="signature">scroll(dx=0, dy=0) -> None</span></div> -</div> -<p>Move the image by dx pixels right and dy pixels down. dx and dy may be -negative for left and up scrolls respectively. Areas of the surface that -are not overwritten retain their original pixel values. Scrolling is -contained by the Surface clip area. It is safe to have dx and dy values -that exceed the surface size.</p> -<p>New in Pygame 1.9</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_colorkey"> -<tt class="descname">set_colorkey</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_colorkey" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Set the transparent colorkey</span></div> -<div class="line"><span class="signature">set_colorkey(Color, flags=0) -> None</span></div> -<div class="line"><span class="signature">set_colorkey(None) -> None</span></div> -</div> -<p>Set the current color key for the Surface. When blitting this Surface -onto a destination, and pixels that have the same color as the colorkey -will be transparent. The color can be an <tt class="docutils literal"><span class="pre">RGB</span></tt> color or a mapped color -integer. If None is passed, the colorkey will be unset.</p> -<p>The colorkey will be ignored if the Surface is formatted to use per pixel -alpha values. The colorkey can be mixed with the full Surface alpha -value.</p> -<p>The optional flags argument can be set to <tt class="docutils literal"><span class="pre">pygame.RLEACCEL</span></tt> to provide -better performance on non accelerated displays. An <tt class="docutils literal"><span class="pre">RLEACCEL</span></tt> Surface -will be slower to modify, but quicker to blit as a source.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_colorkey"> -<tt class="descname">get_colorkey</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_colorkey" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Get the current transparent colorkey</span></div> -<div class="line"><span class="signature">get_colorkey() -> RGB or None</span></div> -</div> -<p>Return the current colorkey value for the Surface. If the colorkey is not -set then None is returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_alpha"> -<tt class="descname">set_alpha</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_alpha" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the alpha value for the full Surface image</span></div> -<div class="line"><span class="signature">set_alpha(value, flags=0) -> None</span></div> -<div class="line"><span class="signature">set_alpha(None) -> None</span></div> -</div> -<p>Set the current alpha value fo r the Surface. When blitting this Surface -onto a destination, the pixels will be drawn slightly transparent. The -alpha value is an integer from 0 to 255, 0 is fully transparent and 255 -is fully opaque. If None is passed for the alpha value, then the Surface -alpha will be disabled.</p> -<p>This value is different than the per pixel Surface alpha. If the Surface -format contains per pixel alphas, then this alpha value will be ignored. -If the Surface contains per pixel alphas, setting the alpha value to None -will disable the per pixel transparency.</p> -<p>The optional flags argument can be set to <tt class="docutils literal"><span class="pre">pygame.RLEACCEL</span></tt> to provide -better performance on non accelerated displays. An <tt class="docutils literal"><span class="pre">RLEACCEL</span></tt> Surface -will be slower to modify, but quicker to blit as a source.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_alpha"> -<tt class="descname">get_alpha</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_alpha" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current Surface transparency value</span></div> -<div class="line"><span class="signature">get_alpha() -> int_value or None</span></div> -</div> -<p>Return the current alpha value for the Surface. If the alpha value is not -set then None is returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.lock"> -<tt class="descname">lock</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.lock" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">lock the Surface memory for pixel access</span></div> -<div class="line"><span class="signature">lock() -> None</span></div> -</div> -<p>Lock the pixel data of a Surface for access. On accelerated Surfaces, the -pixel data may be stored in volatile video memory or nonlinear compressed -forms. When a Surface is locked the pixel memory becomes available to -access by regular software. Code that reads or writes pixel values will -need the Surface to be locked.</p> -<p>Surfaces should not remain locked for more than necessary. A locked -Surface can often not be displayed or managed by Pygame.</p> -<p>Not all Surfaces require locking. The <tt class="docutils literal"><span class="pre">Surface.mustlock()</span></tt> method can -determine if it is actually required. There is no performance penalty for -locking and unlocking a Surface that does not need it.</p> -<p>All pygame functions will automatically lock and unlock the Surface data -as needed. If a section of code is going to make calls that will -repeatedly lock and unlock the Surface many times, it can be helpful to -wrap the block inside a lock and unlock pair.</p> -<p>It is safe to nest locking and unlocking calls. The surface will only be -unlocked after the final lock is released.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.unlock"> -<tt class="descname">unlock</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.unlock" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">unlock the Surface memory from pixel access</span></div> -<div class="line"><span class="signature">unlock() -> None</span></div> -</div> -<p>Unlock the Surface pixel data after it has been locked. The unlocked -Surface can once again be drawn and managed by Pygame. See the -<tt class="docutils literal"><span class="pre">Surface.lock()</span></tt> documentation for more details.</p> -<p>All pygame functions will automatically lock and unlock the Surface data -as needed. If a section of code is going to make calls that will -repeatedly lock and unlock the Surface many times, it can be helpful to -wrap the block inside a lock and unlock pair.</p> -<p>It is safe to nest locking and unlocking calls. The surface will only be -unlocked after the final lock is released.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.mustlock"> -<tt class="descname">mustlock</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.mustlock" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if the Surface requires locking</span></div> -<div class="line"><span class="signature">mustlock() -> bool</span></div> -</div> -<p>Returns True if the Surface is required to be locked to access pixel -data. Usually pure software Surfaces do not require locking. This method -is rarely needed, since it is safe and quickest to just lock all Surfaces -as needed.</p> -<p>All pygame functions will automatically lock and unlock the Surface data -as needed. If a section of code is going to make calls that will -repeatedly lock and unlock the Surface many times, it can be helpful to -wrap the block inside a lock and unlock pair.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_locked"> -<tt class="descname">get_locked</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_locked" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">test if the Surface is current locked</span></div> -<div class="line"><span class="signature">get_locked() -> bool</span></div> -</div> -<p>Returns True when the Surface is locked. It doesn’t matter how many times -the Surface is locked.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_locks"> -<tt class="descname">get_locks</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_locks" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the locks for the Surface</span></div> -<div class="line"><span class="signature">get_locks() -> tuple</span></div> -</div> -<p>Returns the currently existing locks for the Surface.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_at"> -<tt class="descname">get_at</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_at" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the color value at a single pixel</span></div> -<div class="line"><span class="signature">get_at((x, y)) -> Color</span></div> -</div> -<p>Return a copy of the <tt class="docutils literal"><span class="pre">RGBA</span></tt> Color value at the given pixel. If the -Surface has no per pixel alpha, then the alpha value will always be 255 -(opaque). If the pixel position is outside the area of the Surface an -IndexError exception will be raised.</p> -<p>Getting and setting pixels one at a time is generally too slow to be used -in a game or realtime situation. It is better to use methods which -operate on many pixels at a time like with the blit, fill and draw -methods - or by using surfarray/PixelArray.</p> -<p>This function will temporarily lock and unlock the Surface as needed.</p> -<p>Returning a Color instead of tuple, New in pygame 1.9.0. Use -<tt class="docutils literal"><span class="pre">tuple(surf.get_at((x,y)))</span></tt> if you want a tuple, and not a Color. This -should only matter if you want to use the color as a key in a dict.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_at"> -<tt class="descname">set_at</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_at" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the color value for a single pixel</span></div> -<div class="line"><span class="signature">set_at((x, y), Color) -> None</span></div> -</div> -<p>Set the <tt class="docutils literal"><span class="pre">RGBA</span></tt> or mapped integer color value for a single pixel. If the -Surface does not have per pixel alphas, the alpha value is ignored. -Settting pixels outside the Surface area or outside the Surface clipping -will have no effect.</p> -<p>Getting and setting pixels one at a time is generally too slow to be used -in a game or realtime situation.</p> -<p>This function will temporarily lock and unlock the Surface as needed.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_at_mapped"> -<tt class="descname">get_at_mapped</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_at_mapped" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the mapped color value at a single pixel</span></div> -<div class="line"><span class="signature">get_at_mapped((x, y)) -> Color</span></div> -</div> -<p>Return the integer value of the given pixel. If the pixel position is -outside the area of the Surface an IndexError exception will be raised.</p> -<p>This method is intended for Pygame unit testing. It unlikely has any use -in an application.</p> -<p>This function will temporarily lock and unlock the Surface as needed.</p> -<p>New in pygame. 1.9.2.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_palette"> -<tt class="descname">get_palette</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_palette" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the color index palette for an 8bit Surface</span></div> -<div class="line"><span class="signature">get_palette() -> [RGB, RGB, RGB, ...]</span></div> -</div> -<p>Return a list of up to 256 color elements that represent the indexed -colors used in an 8bit Surface. The returned list is a copy of the -palette, and changes will have no effect on the Surface.</p> -<p>Returning a list of <tt class="docutils literal"><span class="pre">Color(with</span> <span class="pre">length</span> <span class="pre">3)</span></tt> instances instead of tuples, -New in pygame 1.9.0</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_palette_at"> -<tt class="descname">get_palette_at</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_palette_at" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the color for a single entry in a palette</span></div> -<div class="line"><span class="signature">get_palette_at(index) -> RGB</span></div> -</div> -<p>Returns the red, green, and blue color values for a single index in a -Surface palette. The index should be a value from 0 to 255.</p> -<p>Returning <tt class="docutils literal"><span class="pre">Color(with</span> <span class="pre">length</span> <span class="pre">3)</span></tt> instance instead of a tuple, New in -pygame 1.9.0</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_palette"> -<tt class="descname">set_palette</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_palette" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the color palette for an 8bit Surface</span></div> -<div class="line"><span class="signature">set_palette([RGB, RGB, RGB, ...]) -> None</span></div> -</div> -<p>Set the full palette for an 8bit Surface. This will replace the colors in -the existing palette. A partial palette can be passed and only the first -colors in the original palette will be changed.</p> -<p>This function has no effect on a Surface with more than 8bits per pixel.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_palette_at"> -<tt class="descname">set_palette_at</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_palette_at" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the color for a single index in an 8bit Surface palette</span></div> -<div class="line"><span class="signature">set_palette_at(index, RGB) -> None</span></div> -</div> -<p>Set the palette value for a single entry in a Surface palette. The index -should be a value from 0 to 255.</p> -<p>This function has no effect on a Surface with more than 8bits per pixel.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.map_rgb"> -<tt class="descname">map_rgb</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.map_rgb" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">convert a color into a mapped color value</span></div> -<div class="line"><span class="signature">map_rgb(Color) -> mapped_int</span></div> -</div> -<p>Convert an <tt class="docutils literal"><span class="pre">RGBA</span></tt> color into the mapped integer value for this Surface. -The returned integer will contain no more bits than the bit depth of the -Surface. Mapped color values are not often used inside Pygame, but can be -passed to most functions that require a Surface and a color.</p> -<p>See the Surface object documentation for more information about colors -and pixel formats.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.unmap_rgb"> -<tt class="descname">unmap_rgb</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.unmap_rgb" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">convert a mapped integer color value into a Color</span></div> -<div class="line"><span class="signature">unmap_rgb(mapped_int) -> Color</span></div> -</div> -<p>Convert an mapped integer color into the <tt class="docutils literal"><span class="pre">RGB</span></tt> color components for -this Surface. Mapped color values are not often used inside Pygame, but -can be passed to most functions that require a Surface and a color.</p> -<p>See the Surface object documentation for more information about colors -and pixel formats.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_clip"> -<tt class="descname">set_clip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_clip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the current clipping area of the Surface</span></div> -<div class="line"><span class="signature">set_clip(rect) -> None</span></div> -<div class="line"><span class="signature">set_clip(None) -> None</span></div> -</div> -<p>Each Surface has an active clipping area. This is a rectangle that -represents the only pixels on the Surface that can be modified. If None -is passed for the rectangle the full Surface will be available for -changes.</p> -<p>The clipping area is always restricted to the area of the Surface itself. -If the clip rectangle is too large it will be shrunk to fit inside the -Surface.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_clip"> -<tt class="descname">get_clip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_clip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the current clipping area of the Surface</span></div> -<div class="line"><span class="signature">get_clip() -> Rect</span></div> -</div> -<p>Return a rectangle of the current clipping area. The Surface will always -return a valid rectangle that will never be outside the bounds of the -image. If the Surface has had None set for the clipping area, the Surface -will return a rectangle with the full area of the Surface.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.subsurface"> -<tt class="descname">subsurface</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.subsurface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create a new surface that references its parent</span></div> -<div class="line"><span class="signature">subsurface(Rect) -> Surface</span></div> -</div> -<p>Returns a new Surface that shares its pixels with its new parent. The new -Surface is considered a child of the original. Modifications to either -Surface pixels will effect each other. Surface information like clipping -area and color keys are unique to each Surface.</p> -<p>The new Surface will inherit the palette, color key, and alpha settings -from its parent.</p> -<p>It is possible to have any number of subsurfaces and subsubsurfaces on -the parent. It is also possible to subsurface the display Surface if the -display mode is not hardware accelerated.</p> -<p>See the <tt class="docutils literal"><span class="pre">Surface.get_offset()</span></tt>, <tt class="docutils literal"><span class="pre">Surface.get_parent()</span></tt> to learn more -about the state of a subsurface.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_parent"> -<tt class="descname">get_parent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_parent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find the parent of a subsurface</span></div> -<div class="line"><span class="signature">get_parent() -> Surface</span></div> -</div> -<p>Returns the parent Surface of a subsurface. If this is not a subsurface -then None will be returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_abs_parent"> -<tt class="descname">get_abs_parent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_abs_parent" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find the top level parent of a subsurface</span></div> -<div class="line"><span class="signature">get_abs_parent() -> Surface</span></div> -</div> -<p>Returns the parent Surface of a subsurface. If this is not a subsurface -then this surface will be returned.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_offset"> -<tt class="descname">get_offset</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_offset" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find the position of a child subsurface inside a parent</span></div> -<div class="line"><span class="signature">get_offset() -> (x, y)</span></div> -</div> -<p>Get the offset position of a child subsurface inside of a parent. If the -Surface is not a subsurface this will return (0, 0).</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_abs_offset"> -<tt class="descname">get_abs_offset</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_abs_offset" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find the absolute position of a child subsurface inside its top level parent</span></div> -<div class="line"><span class="signature">get_abs_offset() -> (x, y)</span></div> -</div> -<p>Get the offset position of a child subsurface inside of its top level -parent Surface. If the Surface is not a subsurface this will return (0, -0).</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_size"> -<tt class="descname">get_size</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_size" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the dimensions of the Surface</span></div> -<div class="line"><span class="signature">get_size() -> (width, height)</span></div> -</div> -<p>Return the width and height of the Surface in pixels.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_width"> -<tt class="descname">get_width</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_width" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the width of the Surface</span></div> -<div class="line"><span class="signature">get_width() -> width</span></div> -</div> -<p>Return the width of the Surface in pixels.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_height"> -<tt class="descname">get_height</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_height" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the height of the Surface</span></div> -<div class="line"><span class="signature">get_height() -> height</span></div> -</div> -<p>Return the height of the Surface in pixels.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_rect"> -<tt class="descname">get_rect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_rect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the rectangular area of the Surface</span></div> -<div class="line"><span class="signature">get_rect(**kwargs) -> Rect</span></div> -</div> -<p>Returns a new rectangle covering the entire surface. This rectangle will -always start at 0, 0 with a width. and height the same size as the image.</p> -<p>You can pass keyword argument values to this function. These named values -will be applied to the attributes of the Rect before it is returned. An -example would be ‘mysurf.get_rect(center=(100,100))’ to create a -rectangle for the Surface centered at a given position.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_bitsize"> -<tt class="descname">get_bitsize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_bitsize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the bit depth of the Surface pixel format</span></div> -<div class="line"><span class="signature">get_bitsize() -> int</span></div> -</div> -<p>Returns the number of bits used to represent each pixel. This value may -not exactly fill the number of bytes used per pixel. For example a 15 bit -Surface still requires a full 2 bytes.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_bytesize"> -<tt class="descname">get_bytesize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_bytesize" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the bytes used per Surface pixel</span></div> -<div class="line"><span class="signature">get_bytesize() -> int</span></div> -</div> -<p>Return the number of bytes used per pixel.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_flags"> -<tt class="descname">get_flags</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_flags" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the additional flags used for the Surface</span></div> -<div class="line"><span class="signature">get_flags() -> int</span></div> -</div> -<p>Returns a set of current Surface features. Each feature is a bit in the -flags bitmask. Typical flags are <tt class="docutils literal"><span class="pre">HWSURFACE</span></tt>, <tt class="docutils literal"><span class="pre">RLEACCEL</span></tt>, -<tt class="docutils literal"><span class="pre">SRCALPHA</span></tt>, and <tt class="docutils literal"><span class="pre">SRCCOLORKEY</span></tt>.</p> -<p>Here is a more complete list of flags. A full list can be found in -<tt class="docutils literal"><span class="pre">SDL_video.h</span></tt></p> -<div class="highlight-python"><pre>SWSURFACE 0x00000000 # Surface is in system memory -HWSURFACE 0x00000001 # Surface is in video memory -ASYNCBLIT 0x00000004 # Use asynchronous blits if possible</pre> -</div> -<p>Available for <tt class="docutils literal"><span class="pre">pygame.display.set_mode()</span></tt></p> -<div class="highlight-python"><pre>ANYFORMAT 0x10000000 # Allow any video depth/pixel-format -HWPALETTE 0x20000000 # Surface has exclusive palette -DOUBLEBUF 0x40000000 # Set up double-buffered video mode -FULLSCREEN 0x80000000 # Surface is a full screen display -OPENGL 0x00000002 # Create an OpenGL rendering context -OPENGLBLIT 0x0000000A # Create an OpenGL rendering context - # and use it for blitting. Obsolete. -RESIZABLE 0x00000010 # This video mode may be resized -NOFRAME 0x00000020 # No window caption or edge frame</pre> -</div> -<p>Used internally (read-only)</p> -<div class="highlight-python"><pre>HWACCEL 0x00000100 # Blit uses hardware acceleration -SRCCOLORKEY 0x00001000 # Blit uses a source color key -RLEACCELOK 0x00002000 # Private flag -RLEACCEL 0x00004000 # Surface is RLE encoded -SRCALPHA 0x00010000 # Blit uses source alpha blending -PREALLOC 0x01000000 # Surface uses preallocated memory</pre> -</div> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_pitch"> -<tt class="descname">get_pitch</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_pitch" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the number of bytes used per Surface row</span></div> -<div class="line"><span class="signature">get_pitch() -> int</span></div> -</div> -<p>Return the number of bytes separating each row in the Surface. Surfaces -in video memory are not always linearly packed. Subsurfaces will also -have a larger pitch than their real width.</p> -<p>This value is not needed for normal Pygame usage.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_masks"> -<tt class="descname">get_masks</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_masks" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the bitmasks needed to convert between a color and a mapped integer</span></div> -<div class="line"><span class="signature">get_masks() -> (R, G, B, A)</span></div> -</div> -<p>Returns the bitmasks used to isolate each color in a mapped integer.</p> -<p>This value is not needed for normal Pygame usage.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_masks"> -<tt class="descname">set_masks</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_masks" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set the bitmasks needed to convert between a color and a mapped integer</span></div> -<div class="line"><span class="signature">set_masks((r,g,b,a)) -> None</span></div> -</div> -<p>This is not needed for normal Pygame usage. New in pygame 1.8.1</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_shifts"> -<tt class="descname">get_shifts</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_shifts" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the bit shifts needed to convert between a color and a mapped integer</span></div> -<div class="line"><span class="signature">get_shifts() -> (R, G, B, A)</span></div> -</div> -<p>Returns the pixel shifts need to convert between each color and a mapped -integer.</p> -<p>This value is not needed for normal Pygame usage.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.set_shifts"> -<tt class="descname">set_shifts</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.set_shifts" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">sets the bit shifts needed to convert between a color and a mapped integer</span></div> -<div class="line"><span class="signature">set_shifts((r,g,b,a)) -> None</span></div> -</div> -<p>This is not needed for normal Pygame usage. New in pygame 1.8.1</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_losses"> -<tt class="descname">get_losses</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_losses" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">the significant bits used to convert between a color and a mapped integer</span></div> -<div class="line"><span class="signature">get_losses() -> (R, G, B, A)</span></div> -</div> -<p>Return the least significant number of bits stripped from each color in a -mapped integer.</p> -<p>This value is not needed for normal Pygame usage.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_bounding_rect"> -<tt class="descname">get_bounding_rect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_bounding_rect" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find the smallest rect containing data</span></div> -<div class="line"><span class="signature">get_bounding_rect(min_alpha = 1) -> Rect</span></div> -</div> -<p>Returns the smallest rectangular region that contains all the pixels in -the surface that have an alpha value greater than or equal to the minimum -alpha value.</p> -<p>This function will temporarily lock and unlock the Surface as needed.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_view"> -<tt class="descname">get_view</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_view" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">return a view of a surface’s pixel data.</span></div> -<div class="line"><span class="signature">get_view(kind=‘2’) -> <view></span></div> -</div> -<p>Return an object which exposes a surface’s internal pixel buffer to a -NumPy array. For now a custom object with an array struct interface is -returned. A Python memoryview may be returned in the future. The buffer -is writeable.</p> -<p>The kind argument is the length 1 string ‘2’, ‘3’, ‘r’, ‘g’, ‘b’, or ‘a’. -The letters are case insensitive; ‘A’ will work as well. The argument can -be either a Unicode or byte (char) string. The default is ‘2’.</p> -<p>A kind ‘2’ view is a (surface-width, surface-height) array of raw pixels. -The pixels are surface bytesized unsigned integers. The pixel format is -surface specific. The 3 byte unsigned integers of 24 bit surfaces are -unlikely accepted by anything other than other Pygame functions.</p> -<p>‘3’ returns a (surface-width, surface-height, 3) view of <tt class="docutils literal"><span class="pre">RGB</span></tt> color -components. Each of the red, green, and blue components are unsigned -bytes. Only 24-bit and 32-bit surfaces are supported. The color -components must be in either <tt class="docutils literal"><span class="pre">RGB</span></tt> or <tt class="docutils literal"><span class="pre">BGR</span></tt> order within the pixel.</p> -<p>‘r’ for red, ‘g’ for green, ‘b’ for blue, and ‘a’ for alpha return a -(surface-width, surface-height) view of a single color component within a -surface: a color plane. Color components are unsigned bytes. Both 24-bit -and 32-bit surfaces support ‘r’, ‘g’, and ‘b’. Only 32-bit surfaces with -<tt class="docutils literal"><span class="pre">SRCALPHA</span></tt> support ‘a’.</p> -<p>This method implicitly locks the Surface. The lock will be released, once -the returned view object is deleted.</p> -<p>New in pygame 1.9.2.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.Surface.get_buffer"> -<tt class="descname">get_buffer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.Surface.get_buffer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">acquires a buffer object for the pixels of the Surface.</span></div> -<div class="line"><span class="signature">get_buffer() -> BufferProxy</span></div> -</div> -<p>Return a buffer object for the pixels of the Surface. The buffer can be -used for direct pixel access and manipulation.</p> -<p>This method implicitly locks the Surface. The lock will be released, once -the returned BufferProxy object is deleted.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="surfarray.html" title="pygame.surfarray" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="sprite.html" title="pygame.sprite" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/surfarray.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,470 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.surfarray — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.tests" href="tests.html" /> - <link rel="prev" title="pygame.Surface" href="surface.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.surfarray"> -<span id="pygame-surfarray"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.surfarray</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for accessing surface pixel data using array interfaces</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="35%" /> -<col width="1%" /> -<col width="64%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.array2d">pygame.surfarray.array2d</a></td> -<td>—</td> -<td>Copy pixels into a 2d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.pixels2d">pygame.surfarray.pixels2d</a></td> -<td>—</td> -<td>Reference pixels into a 2d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.array3d">pygame.surfarray.array3d</a></td> -<td>—</td> -<td>Copy pixels into a 3d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.pixels3d">pygame.surfarray.pixels3d</a></td> -<td>—</td> -<td>Reference pixels into a 3d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.array_alpha">pygame.surfarray.array_alpha</a></td> -<td>—</td> -<td>Copy pixel alphas into a 2d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.pixels_alpha">pygame.surfarray.pixels_alpha</a></td> -<td>—</td> -<td>Reference pixel alphas into a 2d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.pixels_red">pygame.surfarray.pixels_red</a></td> -<td>—</td> -<td>Reference pixel red into a 2d array.</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.pixels_green">pygame.surfarray.pixels_green</a></td> -<td>—</td> -<td>Reference pixel green into a 2d array.</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.pixels_blue">pygame.surfarray.pixels_blue</a></td> -<td>—</td> -<td>Reference pixel blue into a 2d array.</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.array_colorkey">pygame.surfarray.array_colorkey</a></td> -<td>—</td> -<td>Copy the colorkey values into a 2d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.make_surface">pygame.surfarray.make_surface</a></td> -<td>—</td> -<td>Copy an array to a new surface</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.blit_array">pygame.surfarray.blit_array</a></td> -<td>—</td> -<td>Blit directly from a array values</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.map_array">pygame.surfarray.map_array</a></td> -<td>—</td> -<td>Map a 3d array into a 2d array</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.use_arraytype">pygame.surfarray.use_arraytype</a></td> -<td>—</td> -<td>Sets the array system to be used for surface arrays</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.get_arraytype">pygame.surfarray.get_arraytype</a></td> -<td>—</td> -<td>Gets the currently active array type.</td> -</tr> -<tr><td><a class="toc reference external" href="surfarray.html#pygame.surfarray.get_arraytypes">pygame.surfarray.get_arraytypes</a></td> -<td>—</td> -<td>Gets the array system types currently supported.</td> -</tr> -</tbody> -</table> -<p>Functions to convert pixel data between pygame Surfaces and arrays. This module -will only be functional when pygame can use the external Numpy or Numeric -packages.</p> -<p>Every pixel is stored as a single integer value to represent the red, green, -and blue colors. The 8bit images use a value that looks into a colormap. Pixels -with higher depth use a bit packing process to place three or four values into -a single number.</p> -<p>The arrays are indexed by the <tt class="docutils literal"><span class="pre">X</span></tt> axis first, followed by the <tt class="docutils literal"><span class="pre">Y</span></tt> axis. -Arrays that treat the pixels as a single integer are referred to as 2D arrays. -This module can also separate the red, green, and blue color values into -separate indices. These types of arrays are referred to as 3D arrays, and the -last index is 0 for red, 1 for green, and 2 for blue.</p> -<p>Supported array systems are</p> -<div class="highlight-python"><pre>numpy -numeric (deprecated; to be removed in Pygame 1.9.3.)</pre> -</div> -<p>The default will be numpy, if installed. Otherwise, Numeric will be set as -default if installed, and a deprecation warning will be issued. If neither -numpy nor Numeric are installed, the module will raise an ImportError.</p> -<p>The array type to use can be changed at runtime using the use_arraytype () -method, which requires one of the above types as string.</p> -<p>Note: numpy and Numeric are not completely compatible. Certain array -manipulations, which work for one type, might behave differently or even -completely break for the other.</p> -<p>Additionally, in contrast to Numeric, numpy does use unsigned 16-bit integers. -Images with 16-bit data will be treated as unsigned integers. Numeric instead -uses signed integers for the representation, which is important to keep in -mind, if you use the module’s functions and wonder about the values.</p> -<p>The support of numpy is new in Pygame 1.8. Official Numeric deprecation begins -in Pygame 1.9.2.</p> -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.array2d"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">array2d</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.array2d" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Copy pixels into a 2d array</span></div> -<div class="line"><span class="signature">array2d(Surface) -> array</span></div> -</div> -<p>Copy the pixels from a Surface into a 2D array. The bit depth of the surface -will control the size of the integer values, and will work for any type of -pixel format.</p> -<p>This function will temporarily lock the Surface as pixels are copied (see -the <tt class="xref py py-func docutils literal"><span class="pre">Surface.lock()</span></tt> - lock the Surface memory for pixel access method).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.pixels2d"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">pixels2d</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.pixels2d" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Reference pixels into a 2d array</span></div> -<div class="line"><span class="signature">pixels2d(Surface) -> array</span></div> -</div> -<p>Create a new 2D array that directly references the pixel values in a -Surface. Any changes to the array will affect the pixels in the Surface. -This is a fast operation since no data is copied.</p> -<p>Pixels from a 24-bit Surface cannot be referenced, but all other Surface bit -depths can.</p> -<p>The Surface this references will remain locked for the lifetime of the array -(see the <tt class="xref py py-func docutils literal"><span class="pre">Surface.lock()</span></tt> - lock the Surface memory for pixel access -method).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.array3d"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">array3d</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.array3d" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Copy pixels into a 3d array</span></div> -<div class="line"><span class="signature">array3d(Surface) -> array</span></div> -</div> -<p>Copy the pixels from a Surface into a 3D array. The bit depth of the surface -will control the size of the integer values, and will work for any type of -pixel format.</p> -<p>This function will temporarily lock the Surface as pixels are copied (see -the <tt class="xref py py-func docutils literal"><span class="pre">Surface.lock()</span></tt> - lock the Surface memory for pixel access method).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.pixels3d"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">pixels3d</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.pixels3d" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Reference pixels into a 3d array</span></div> -<div class="line"><span class="signature">pixels3d(Surface) -> array</span></div> -</div> -<p>Create a new 3D array that directly references the pixel values in a -Surface. Any changes to the array will affect the pixels in the Surface. -This is a fast operation since no data is copied.</p> -<p>This will only work on Surfaces that have 24-bit or 32-bit formats. Lower -pixel formats cannot be referenced.</p> -<p>The Surface this references will remain locked for the lifetime of the array -(see the <tt class="xref py py-func docutils literal"><span class="pre">Surface.lock()</span></tt> - lock the Surface memory for pixel access -method).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.array_alpha"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">array_alpha</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.array_alpha" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Copy pixel alphas into a 2d array</span></div> -<div class="line"><span class="signature">array_alpha(Surface) -> array</span></div> -</div> -<p>Copy the pixel alpha values (degree of transparency) from a Surface into a -2D array. This will work for any type of Surface format. Surfaces without a -pixel alpha will return an array with all opaque values.</p> -<p>This function will temporarily lock the Surface as pixels are copied (see -the <tt class="xref py py-func docutils literal"><span class="pre">Surface.lock()</span></tt> - lock the Surface memory for pixel access method).</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.pixels_alpha"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">pixels_alpha</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.pixels_alpha" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Reference pixel alphas into a 2d array</span></div> -<div class="line"><span class="signature">pixels_alpha(Surface) -> array</span></div> -</div> -<p>Create a new 2D array that directly references the alpha values (degree of -transparency) in a Surface. Any changes to the array will affect the pixels -in the Surface. This is a fast operation since no data is copied.</p> -<p>This can only work on 32-bit Surfaces with a per-pixel alpha value.</p> -<p>The Surface this array references will remain locked for the lifetime of the -array.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.pixels_red"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">pixels_red</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.pixels_red" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Reference pixel red into a 2d array.</span></div> -<div class="line"><span class="signature">pixels_red (Surface) -> array</span></div> -</div> -<p>Create a new 2D array that directly references the red values in a Surface. -Any changes to the array will affect the pixels in the Surface. This is a -fast operation since no data is copied.</p> -<p>This can only work on 24-bit or 32-bit Surfaces.</p> -<p>The Surface this array references will remain locked for the lifetime of the -array.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.pixels_green"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">pixels_green</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.pixels_green" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Reference pixel green into a 2d array.</span></div> -<div class="line"><span class="signature">pixels_green (Surface) -> array</span></div> -</div> -<p>Create a new 2D array that directly references the green values in a -Surface. Any changes to the array will affect the pixels in the Surface. -This is a fast operation since no data is copied.</p> -<p>This can only work on 24-bit or 32-bit Surfaces.</p> -<p>The Surface this array references will remain locked for the lifetime of the -array.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.pixels_blue"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">pixels_blue</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.pixels_blue" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Reference pixel blue into a 2d array.</span></div> -<div class="line"><span class="signature">pixels_blue (Surface) -> array</span></div> -</div> -<p>Create a new 2D array that directly references the blue values in a Surface. -Any changes to the array will affect the pixels in the Surface. This is a -fast operation since no data is copied.</p> -<p>This can only work on 24-bit or 32-bit Surfaces.</p> -<p>The Surface this array references will remain locked for the lifetime of the -array.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.array_colorkey"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">array_colorkey</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.array_colorkey" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Copy the colorkey values into a 2d array</span></div> -<div class="line"><span class="signature">array_colorkey(Surface) -> array</span></div> -</div> -<p>Create a new array with the colorkey transparency value from each pixel. If -the pixel matches the colorkey it will be fully tranparent; otherwise it -will be fully opaque.</p> -<p>This will work on any type of Surface format. If the image has no colorkey a -solid opaque array will be returned.</p> -<p>This function will temporarily lock the Surface as pixels are copied.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.make_surface"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">make_surface</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.make_surface" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Copy an array to a new surface</span></div> -<div class="line"><span class="signature">make_surface(array) -> Surface</span></div> -</div> -<p>Create a new Surface that best resembles the data and format on the array. -The array can be 2D or 3D with any sized integer values. Function -make_surface uses the array struct interface to aquire array properties, -so is not limited to just NumPy arrays. See <a class="tooltip reference internal" href="pixelcopy.html#module-pygame.pixelcopy" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.pixelcopy</span></tt><span class="tooltip-content">pygame module for general pixel array copying</span></a>.</p> -<p>New in Pygame 1.9.2: array struct interface support.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.blit_array"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">blit_array</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.blit_array" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Blit directly from a array values</span></div> -<div class="line"><span class="signature">blit_array(Surface, array) -> None</span></div> -</div> -<p>Directly copy values from an array into a Surface. This is faster than -converting the array into a Surface and blitting. The array must be the same -dimensions as the Surface and will completely replace all pixel values. Only -integer, ascii character and record arrays are accepted.</p> -<p>This function will temporarily lock the Surface as the new values are -copied.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.map_array"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">map_array</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.map_array" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Map a 3d array into a 2d array</span></div> -<div class="line"><span class="signature">map_array(Surface, array3d) -> array2d</span></div> -</div> -<p>Convert a 3D array into a 2D array. This will use the given Surface format -to control the conversion. Palette surface formats are supported for numpy -arrays.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.use_arraytype"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">use_arraytype</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.use_arraytype" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Sets the array system to be used for surface arrays</span></div> -<div class="line"><span class="signature">use_arraytype (arraytype) -> None</span></div> -</div> -<p>Uses the requested array type for the module functions. Currently supported -array types are:</p> -<div class="highlight-python"><pre>numeric (deprecated; will be removed in Pygame 1.9.3.) -numpy</pre> -</div> -<p>If the requested type is not available, a ValueError will be raised.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.get_arraytype"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">get_arraytype</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.get_arraytype" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the currently active array type.</span></div> -<div class="line"><span class="signature">get_arraytype () -> str</span></div> -</div> -<p>Returns the currently active array type. This will be a value of the -<tt class="docutils literal"><span class="pre">get_arraytypes()</span></tt> tuple and indicates which type of array module is used -for the array creation.</p> -<p>New in pygame 1.8</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.surfarray.get_arraytypes"> -<tt class="descclassname">pygame.surfarray.</tt><tt class="descname">get_arraytypes</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.surfarray.get_arraytypes" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Gets the array system types currently supported.</span></div> -<div class="line"><span class="signature">get_arraytypes () -> tuple</span></div> -</div> -<p>Checks, which array systems are available and returns them as a tuple of -strings. The values of the tuple can be used directly in the -<a class="tooltip reference internal" href="#pygame.surfarray.use_arraytype" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.surfarray.use_arraytype()</span></tt><span class="tooltip-content">Sets the array system to be used for surface arrays</span></a> () method. If no supported array -system could be found, None will be returned.</p> -<p>New in pygame 1.8.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="tests.html" title="pygame.tests" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="surface.html" title="pygame.Surface" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/tests.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.tests — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.time" href="time.html" /> - <link rel="prev" title="pygame.surfarray" href="surfarray.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.tests"> -<span id="pygame-tests"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.tests</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Pygame unit test suite package</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="31%" /> -<col width="2%" /> -<col width="68%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="tests.html#pygame.tests.run">pygame.tests.run</a></td> -<td>—</td> -<td>Run the Pygame unit test suite</td> -</tr> -</tbody> -</table> -<p>A quick way to run the test suite package from the command line is to import -the go submodule with the Python -m option:</p> -<div class="highlight-python"><pre>python -m pygame.tests [<test options>]</pre> -</div> -<p>Command line option –help displays a usage message. Available options -correspond to the <a class="tooltip reference internal" href="#pygame.tests.run" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.tests.run()</span></tt><span class="tooltip-content">Run the Pygame unit test suite</span></a> arguments.</p> -<p>The xxxx_test submodules of the tests package are unit test suites for -individual parts of Pygame. Each can also be run as a main program. This is -useful if the test, such as cdrom_test, is interactive.</p> -<p>For Pygame development the test suite can be run from a Pygame distribution -root directory. Program <tt class="docutils literal"><span class="pre">run_tests.py</span></tt> is provided for convenience, though -test/go.py can be run directly.</p> -<p>Module level tags control which modules are included in a unit test run. Tags -are assigned to a unit test module with a corresponding <<ame>_tags.py module. -The tags module has the global __tags__, a list of tag names. For example, -<tt class="docutils literal"><span class="pre">cdrom_test.py</span></tt> has a tag file <tt class="docutils literal"><span class="pre">cdrom_tags.py</span></tt> containing a tags list that -has the ‘interactive’ string. The ‘interactive’ tag indicates <tt class="docutils literal"><span class="pre">cdrom_test.py</span></tt> -expects user input. It is excluded from a <tt class="docutils literal"><span class="pre">run_tests.py</span></tt> or -<tt class="docutils literal"><span class="pre">pygame.tests.go</span></tt> run. Two other tags that are excluded are ‘ignore’ and -‘subprocess_ignore’. These two tags indicate unit tests that will not run on a -particular platform, or for which no corresponding Pygame module is available. -The test runner will list each excluded module along with the tag responsible.</p> -<dl class="definition function"> -<dt class="title" id="pygame.tests.run"> -<tt class="descclassname">pygame.tests.</tt><tt class="descname">run</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.tests.run" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">Run the Pygame unit test suite</span></div> -<div class="line"><span class="signature">run(*args, **kwds) -> tuple</span></div> -</div> -<p>Positional arguments (optional):</p> -<div class="highlight-python"><pre>The names of tests to include. If omitted then all tests are run. Test names -need not include the trailing '_test'.</pre> -</div> -<p>Keyword arguments:</p> -<div class="highlight-python"><pre>incomplete - fail incomplete tests (default False) -nosubprocess - run all test suites in the current process - (default False, use separate subprocesses) -dump - dump failures/errors as dict ready to eval (default False) -file - if provided, the name of a file into which to dump failures/errors -timings - if provided, the number of times to run each individual test to - get an average run time (default is run each test once) -exclude - A list of TAG names to exclude from the run -show_output - show silenced stderr/stdout on errors (default False) -all - dump all results, not just errors (default False) -randomize - randomize order of tests (default False) -seed - if provided, a seed randomizer integer -multi_thread - if provided, the number of THREADS in which to run - subprocessed tests -time_out - if subprocess is True then the time limit in seconds before - killing a test (default 30) -fake - if provided, the name of the fake tests package in the - run_tests__tests subpackage to run instead of the normal - Pygame tests -python - the path to a python executable to run subprocessed tests - (default sys.executable)</pre> -</div> -<p>Return value:</p> -<div class="highlight-python"><pre>A tuple of total number of tests run, dictionary of error information. -The dictionary is empty if no errors were recorded.</pre> -</div> -<p>By default individual test modules are run in separate subprocesses. This -recreates normal Pygame usage where <tt class="docutils literal"><span class="pre">pygame.init()</span></tt> and <tt class="docutils literal"><span class="pre">pygame.quit()</span></tt> -are called only once per program execution, and avoids unfortunate -interactions between test modules. Also, a time limit is placed on test -execution, so frozen tests are killed when there time allotment expired. Use -the single process option if threading is not working properly or if tests -are taking too long. It is not guaranteed that all tests will pass in single -process mode.</p> -<p>Tests are run in a randomized order if the randomize argument is True or a -seed argument is provided. If no seed integer is provided then the system -time is used.</p> -<p>Individual test modules may have a __tags__ attribute, a list of tag strings -used to selectively omit modules from a run. By default only ‘interactive’ -modules such as cdrom_test are ignored. An interactive module must be run -from the console as a Python program.</p> -<p>This function can only be called once per Python session. It is not -reentrant.</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="time.html" title="pygame.time" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="surfarray.html" title="pygame.surfarray" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/time.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,331 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.time — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="pygame.transform" href="transform.html" /> - <link rel="prev" title="pygame.tests" href="tests.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.time"> -<span id="pygame-time"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.time</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module for monitoring time</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="29%" /> -<col width="1%" /> -<col width="70%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="time.html#pygame.time.get_ticks">pygame.time.get_ticks</a></td> -<td>—</td> -<td>get the time in milliseconds</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.wait">pygame.time.wait</a></td> -<td>—</td> -<td>pause the program for an amount of time</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.delay">pygame.time.delay</a></td> -<td>—</td> -<td>pause the program for an amount of time</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.set_timer">pygame.time.set_timer</a></td> -<td>—</td> -<td>repeatedly create an event on the event queue</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.Clock">pygame.time.Clock</a></td> -<td>—</td> -<td>create an object to help track time</td> -</tr> -</tbody> -</table> -<p>Times in pygame are represented in milliseconds (1/1000 seconds). Most -platforms have a limited time resolution of around 10 milliseconds. This -resolution, in milliseconds, is given in the <tt class="docutils literal"><span class="pre">TIMER_RESOLUTION</span></tt> constant.</p> -<dl class="definition function"> -<dt class="title" id="pygame.time.get_ticks"> -<tt class="descclassname">pygame.time.</tt><tt class="descname">get_ticks</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.get_ticks" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">get the time in milliseconds</span></div> -<div class="line"><span class="signature">get_ticks() -> milliseconds</span></div> -</div> -<p>Return the number of millisconds since <tt class="docutils literal"><span class="pre">pygame.init()</span></tt> was called. Before -pygame is initialized this will always be 0.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.time.wait"> -<tt class="descclassname">pygame.time.</tt><tt class="descname">wait</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.wait" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pause the program for an amount of time</span></div> -<div class="line"><span class="signature">wait(milliseconds) -> time</span></div> -</div> -<p>Will pause for a given number of milliseconds. This function sleeps the -process to share the processor with other programs. A program that waits for -even a few milliseconds will consume very little processor time. It is -slightly less accurate than the <tt class="docutils literal"><span class="pre">pygame.time.delay()</span></tt> function.</p> -<p>This returns the actual number of milliseconds used.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.time.delay"> -<tt class="descclassname">pygame.time.</tt><tt class="descname">delay</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.delay" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pause the program for an amount of time</span></div> -<div class="line"><span class="signature">delay(milliseconds) -> time</span></div> -</div> -<p>Will pause for a given number of milliseconds. This function will use the -processor (rather than sleeping) in order to make the delay more accurate -than <tt class="docutils literal"><span class="pre">pygame.time.wait()</span></tt>.</p> -<p>This returns the actual number of milliseconds used.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.time.set_timer"> -<tt class="descclassname">pygame.time.</tt><tt class="descname">set_timer</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.set_timer" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">repeatedly create an event on the event queue</span></div> -<div class="line"><span class="signature">set_timer(eventid, milliseconds) -> None</span></div> -</div> -<p>Set an event type to appear on the event queue every given number of -milliseconds. The first event will not appear until the amount of time has -passed.</p> -<p>Every event type can have a separate timer attached to it. It is best to use -the value between <tt class="docutils literal"><span class="pre">pygame.USEREVENT</span></tt> and <tt class="docutils literal"><span class="pre">pygame.NUMEVENTS</span></tt>.</p> -<p>To disable the timer for an event, set the milliseconds argument to 0.</p> -</dd></dl> - -<dl class="definition class"> -<dt class="title" id="pygame.time.Clock"> -<em class="property">class </em><tt class="descclassname">pygame.time.</tt><tt class="descname">Clock</tt><a class="headerlink" href="#pygame.time.Clock" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">create an object to help track time</span></div> -<div class="line"><span class="signature">Clock() -> Clock</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="41%" /> -<col width="1%" /> -<col width="57%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="time.html#pygame.time.Clock.tick">pygame.time.Clock.tick</a></td> -<td>—</td> -<td>update the clock</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.Clock.tick_busy_loop">pygame.time.Clock.tick_busy_loop</a></td> -<td>—</td> -<td>update the clock</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.Clock.get_time">pygame.time.Clock.get_time</a></td> -<td>—</td> -<td>time used in the previous tick</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.Clock.get_rawtime">pygame.time.Clock.get_rawtime</a></td> -<td>—</td> -<td>actual time used in the previous tick</td> -</tr> -<tr><td><a class="toc reference external" href="time.html#pygame.time.Clock.get_fps">pygame.time.Clock.get_fps</a></td> -<td>—</td> -<td>compute the clock framerate</td> -</tr> -</tbody> -</table> -<p>Creates a new Clock object that can be used to track an amount of time. The -clock also provides several functions to help control a game’s framerate.</p> -<dl class="definition method"> -<dt class="title" id="pygame.time.Clock.tick"> -<tt class="descname">tick</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.Clock.tick" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">update the clock</span></div> -<div class="line"><span class="signature">tick(framerate=0) -> milliseconds</span></div> -<div class="line">:sg:` -> `</div> -</div> -<p>This method should be called once per frame. It will compute how many -milliseconds have passed since the previous call.</p> -<p>If you pass the optional framerate argument the function will delay to -keep the game running slower than the given ticks per second. This can be -used to help limit the runtime speed of a game. By calling -<tt class="docutils literal"><span class="pre">Clock.tick(40)</span></tt> once per frame, the program will never run at more -than 40 frames per second.</p> -<p>Note that this function uses SDL_Delay function which is not accurate on -every platform, but does not use much cpu. Use tick_busy_loop if you want -an accurate timer, and don’t mind chewing cpu.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.time.Clock.tick_busy_loop"> -<tt class="descname">tick_busy_loop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.Clock.tick_busy_loop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">update the clock</span></div> -<div class="line"><span class="signature">tick_busy_loop(framerate=0) -> milliseconds</span></div> -<div class="line">:sg:` -> `</div> -</div> -<p>This method should be called once per frame. It will compute how many -milliseconds have passed since the previous call.</p> -<p>If you pass the optional framerate argument the function will delay to -keep the game running slower than the given ticks per second. This can be -used to help limit the runtime speed of a game. By calling -<tt class="docutils literal"><span class="pre">Clock.tick_busy_loop(40)</span></tt> once per frame, the program will never run at -more than 40 frames per second.</p> -<p>Note that this function uses <a class="tooltip reference internal" href="#pygame.time.delay" title=""><tt class="xref py py-func docutils literal"><span class="pre">pygame.time.delay()</span></tt><span class="tooltip-content">pause the program for an amount of time</span></a>, which uses lots -of cpu in a busy loop to make sure that timing is more acurate.</p> -<p>New in pygame 1.8.0.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.time.Clock.get_time"> -<tt class="descname">get_time</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.Clock.get_time" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">time used in the previous tick</span></div> -<div class="line"><span class="signature">get_time() -> milliseconds</span></div> -</div> -<p>Returns the parameter passed to the last call to <tt class="docutils literal"><span class="pre">Clock.tick()</span></tt>. It is -the number of milliseconds passed between the previous two calls to -<tt class="docutils literal"><span class="pre">Pygame.tick()</span></tt>.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.time.Clock.get_rawtime"> -<tt class="descname">get_rawtime</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.Clock.get_rawtime" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">actual time used in the previous tick</span></div> -<div class="line"><span class="signature">get_rawtime() -> milliseconds</span></div> -</div> -<p>Similar to <tt class="docutils literal"><span class="pre">Clock.get_time()</span></tt>, but this does not include any time used -while <tt class="docutils literal"><span class="pre">Clock.tick()</span></tt> was delaying to limit the framerate.</p> -</dd></dl> - -<dl class="definition method"> -<dt class="title" id="pygame.time.Clock.get_fps"> -<tt class="descname">get_fps</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.time.Clock.get_fps" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">compute the clock framerate</span></div> -<div class="line"><span class="signature">get_fps() -> float</span></div> -</div> -<p>Compute your game’s framerate (in frames per second). It is computed by -averaging the last ten calls to <tt class="docutils literal"><span class="pre">Clock.tick()</span></tt>.</p> -</dd></dl> - -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="transform.html" title="pygame.transform" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="tests.html" title="pygame.tests" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/ref/transform.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,408 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>pygame.transform — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="../_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '../', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="../_static/jquery.js"></script> - <script type="text/javascript" src="../_static/underscore.js"></script> - <script type="text/javascript" src="../_static/doctools.js"></script> - <link rel="shortcut icon" href="../_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" /> - <link rel="next" title="File Path Function Arguments" href="../filepaths.html" /> - <link rel="prev" title="pygame.time" href="time.html" /> - </head> - <body> - - <div class="document"> - - <div class="header"> - <table> - <tr> - <td class="logo"> - <a href="http://www.pygame.org/"> - <img src="../_static/pygame_tiny.png"/> - </a> - <h5>pygame documentation</h5> - </td> - <td class="pagelinks"> - <p class="top"> - || - <a href="http://www.pygame.org/">Pygame Home</a> || - <a href="../index.html">Help Contents</a> || - <a href="../genindex.html">Reference Index</a> || - </p> - <p class="bottom"> - <a href="camera.html">camera</a> || - <a href="cdrom.html">cdrom</a> || - <a href="color.html">Color</a> || - <a href="cursors.html">cursors</a> || - <a href="display.html">display</a> || - <a href="draw.html">draw</a> || - <a href="event.html">event</a> || - <a href="examples.html">examples</a> || - <a href="font.html">font</a> || - <a href="freetype.html">freetype</a> || - <a href="gfxdraw.html">gfxdraw</a> || - <a href="image.html">image</a> || - <a href="joystick.html">joystick</a> || - <a href="key.html">key</a> || - <a href="locals.html">locals</a> || - <a href="mask.html">mask</a> || - <a href="math.html">math</a> || - <a href="midi.html">midi</a> || - <a href="mixer.html">mixer</a> || - <a href="mouse.html">mouse</a> || - <a href="movie.html">movie</a> || - <a href="music.html">music</a> || - <a href="overlay.html">Overlay</a> || - <a href="pixelarray.html">PixelArray</a> || - <a href="pixelcopy.html">pixelcopy</a> || - <a href="pygame.html">pygame</a> || - <a href="rect.html">Rect</a> || - <a href="scrap.html">scrap</a> || - <a href="sndarray.html">sndarray</a> || - <a href="sprite.html">sprite</a> || - <a href="surface.html">Surface</a> || - <a href="surfarray.html">surfarray</a> || - <a href="tests.html">tests</a> || - <a href="time.html">time</a> || - <a href="transform.html">transform</a> || - <a href="pygame.html#module-pygame.version">version</a> - </p> - </td> - </tr> - </table> - </div> - - <div class="documentwrapper"> - <div class="body"> - - <div class="sectionwrapper"> -<div class="section" id="module-pygame.transform"> -<span id="pygame-transform"></span><dl class="definition module"> -<dt class="title module"> -<tt class="docutils literal"><span class="pre">pygame.transform</span></tt></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">pygame module to transform surfaces</span></div> -</div> -<table border="1" class="toc docutils"> -<colgroup> -<col width="32%" /> -<col width="1%" /> -<col width="68%" /> -</colgroup> -<tbody valign="top"> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.flip">pygame.transform.flip</a></td> -<td>—</td> -<td>flip vertically and horizontally</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.scale">pygame.transform.scale</a></td> -<td>—</td> -<td>resize to new resolution</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.rotate">pygame.transform.rotate</a></td> -<td>—</td> -<td>rotate an image</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.rotozoom">pygame.transform.rotozoom</a></td> -<td>—</td> -<td>filtered scale and rotation</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.scale2x">pygame.transform.scale2x</a></td> -<td>—</td> -<td>specialized image doubler</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.smoothscale">pygame.transform.smoothscale</a></td> -<td>—</td> -<td>scale a surface to an arbitrary size smoothly</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.get_smoothscale_backend">pygame.transform.get_smoothscale_backend</a></td> -<td>—</td> -<td>return smoothscale filter version in use: ‘GENERIC’, ‘MMX’, or ‘SSE’</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.set_smoothscale_backend">pygame.transform.set_smoothscale_backend</a></td> -<td>—</td> -<td>set smoothscale filter version to one of: ‘GENERIC’, ‘MMX’, or ‘SSE’</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.chop">pygame.transform.chop</a></td> -<td>—</td> -<td>gets a copy of an image with an interior area removed</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.laplacian">pygame.transform.laplacian</a></td> -<td>—</td> -<td>find edges in a surface</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.average_surfaces">pygame.transform.average_surfaces</a></td> -<td>—</td> -<td>find the average surface from many surfaces.</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.average_color">pygame.transform.average_color</a></td> -<td>—</td> -<td>finds the average color of a surface</td> -</tr> -<tr><td><a class="toc reference external" href="transform.html#pygame.transform.threshold">pygame.transform.threshold</a></td> -<td>—</td> -<td>finds which, and how many pixels in a surface are within a threshold of a color.</td> -</tr> -</tbody> -</table> -<p>A Surface transform is an operation that moves or resizes the pixels. All these -functions take a Surface to operate on and return a new Surface with the -results.</p> -<p>Some of the transforms are considered destructive. These means every time they -are performed they lose pixel data. Common examples of this are resizing and -rotating. For this reason, it is better to retransform the original surface -than to keep transforming an image multiple times. (For example, suppose you -are animating a bouncing spring which expands and contracts. If you applied the -size changes incrementally to the previous images, you would lose detail. -Instead, always begin with the original image and scale to the desired size.)</p> -<dl class="definition function"> -<dt class="title" id="pygame.transform.flip"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">flip</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.flip" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">flip vertically and horizontally</span></div> -<div class="line"><span class="signature">flip(Surface, xbool, ybool) -> Surface</span></div> -</div> -<p>This can flip a Surface either vertically, horizontally, or both. Flipping a -Surface is nondestructive and returns a new Surface with the same -dimensions.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.scale"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">scale</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.scale" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">resize to new resolution</span></div> -<div class="line"><span class="signature">scale(Surface, (width, height), DestSurface = None) -> Surface</span></div> -</div> -<p>Resizes the Surface to a new resolution. This is a fast scale operation that -does not sample the results.</p> -<p>An optional destination surface can be used, rather than have it create a -new one. This is quicker if you want to repeatedly scale something. However -the destination must be the same size as the (width, height) passed in. Also -the destination surface must be the same format.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.rotate"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">rotate</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.rotate" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">rotate an image</span></div> -<div class="line"><span class="signature">rotate(Surface, angle) -> Surface</span></div> -</div> -<p>Unfiltered counterclockwise rotation. The angle argument represents degrees -and can be any floating point value. Negative angle amounts will rotate -clockwise.</p> -<p>Unless rotating by 90 degree increments, the image will be padded larger to -hold the new size. If the image has pixel alphas, the padded area will be -transparent. Otherwise pygame will pick a color that matches the Surface -colorkey or the topleft pixel value.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.rotozoom"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">rotozoom</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.rotozoom" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">filtered scale and rotation</span></div> -<div class="line"><span class="signature">rotozoom(Surface, angle, scale) -> Surface</span></div> -</div> -<p>This is a combined scale and rotation transform. The resulting Surface will -be a filtered 32-bit Surface. The scale argument is a floating point value -that will be multiplied by the current resolution. The angle argument is a -floating point value that represents the counterclockwise degrees to rotate. -A negative rotation angle will rotate clockwise.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.scale2x"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">scale2x</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.scale2x" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">specialized image doubler</span></div> -<div class="line"><span class="signature">scale2x(Surface, DestSurface = None) -> Surface</span></div> -</div> -<p>This will return a new image that is double the size of the original. It -uses the AdvanceMAME Scale2X algorithm which does a ‘jaggie-less’ scale of -bitmap graphics.</p> -<p>This really only has an effect on simple images with solid colors. On -photographic and antialiased images it will look like a regular unfiltered -scale.</p> -<p>An optional destination surface can be used, rather than have it create a -new one. This is quicker if you want to repeatedly scale something. However -the destination must be twice the size of the source surface passed in. Also -the destination surface must be the same format.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.smoothscale"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">smoothscale</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.smoothscale" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">scale a surface to an arbitrary size smoothly</span></div> -<div class="line"><span class="signature">smoothscale(Surface, (width, height), DestSurface = None) -> Surface</span></div> -</div> -<p>Uses one of two different algorithms for scaling each dimension of the input -surface as required. For shrinkage, the output pixels are area averages of -the colors they cover. For expansion, a bilinear filter is used. For the -amd64 and i686 architectures, optimized <tt class="docutils literal"><span class="pre">MMX</span></tt> routines are included and -will run much faster than other machine types. The size is a 2 number -sequence for (width, height). This function only works for 24-bit or 32-bit -surfaces. An exception will be thrown if the input surface bit depth is less -than 24.</p> -<p>New in pygame 1.8</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.get_smoothscale_backend"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">get_smoothscale_backend</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.get_smoothscale_backend" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">return smoothscale filter version in use: ‘GENERIC’, ‘MMX’, or ‘SSE’</span></div> -<div class="line"><span class="signature">get_smoothscale_backend() -> String</span></div> -</div> -<p>Shows whether or not smoothscale is using <tt class="docutils literal"><span class="pre">MMX</span></tt> or <tt class="docutils literal"><span class="pre">SSE</span></tt> acceleration. -If no acceleration is available then “GENERIC” is returned. For a x86 -processor the level of acceleration to use is determined at runtime.</p> -<p>This function is provided for Pygame testing and debugging.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.set_smoothscale_backend"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">set_smoothscale_backend</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.set_smoothscale_backend" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">set smoothscale filter version to one of: ‘GENERIC’, ‘MMX’, or ‘SSE’</span></div> -<div class="line"><span class="signature">set_smoothscale_backend(type) -> None</span></div> -</div> -<p>Sets smoothscale acceleration. Takes a string argument. A value of ‘GENERIC’ -turns off acceleration. ‘MMX’ uses <tt class="docutils literal"><span class="pre">MMX</span></tt> instructions only. ‘SSE’ allows -<tt class="docutils literal"><span class="pre">SSE</span></tt> extensions as well. A value error is raised if type is not -recognized or not supported by the current processor.</p> -<p>This function is provided for Pygame testing and debugging. If smoothscale -causes an invalid instruction error then it is a Pygame/SDL bug that should -be reported. Use this function as a temporary fix only.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.chop"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">chop</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.chop" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">gets a copy of an image with an interior area removed</span></div> -<div class="line"><span class="signature">chop(Surface, rect) -> Surface</span></div> -</div> -<p>Extracts a portion of an image. All vertical and horizontal pixels -surrounding the given rectangle area are removed. The corner areas (diagonal -to the rect) are then brought together. (The original image is not altered -by this operation.)</p> -<p><tt class="docutils literal"><span class="pre">NOTE</span></tt>: If you want a “crop” that returns the part of an image within a -rect, you can blit with a rect to a new surface or copy a subsurface.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.laplacian"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">laplacian</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.laplacian" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find edges in a surface</span></div> -<div class="line"><span class="signature">laplacian(Surface, DestSurface = None) -> Surface</span></div> -</div> -<p>Finds the edges in a surface using the laplacian algorithm.</p> -<p>New in pygame 1.8</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.average_surfaces"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">average_surfaces</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.average_surfaces" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">find the average surface from many surfaces.</span></div> -<div class="line"><span class="signature">average_surfaces(Surfaces, DestSurface = None, palette_colors = 1) -> Surface</span></div> -</div> -<p>Takes a sequence of surfaces and returns a surface with average colors from -each of the surfaces.</p> -<p>palette_colors - if true we average the colors in palette, otherwise we -average the pixel values. This is useful if the surface is actually -greyscale colors, and not palette colors.</p> -<p>Note, this function currently does not handle palette using surfaces -correctly.</p> -<p>New in pygame 1.8 palette_colors argument new in pygame 1.9</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.average_color"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">average_color</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.average_color" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">finds the average color of a surface</span></div> -<div class="line"><span class="signature">average_color(Surface, Rect = None) -> Color</span></div> -</div> -<p>Finds the average color of a Surface or a region of a surface specified by a -Rect, and returns it as a Color.</p> -</dd></dl> - -<dl class="definition function"> -<dt class="title" id="pygame.transform.threshold"> -<tt class="descclassname">pygame.transform.</tt><tt class="descname">threshold</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.transform.threshold" title="Permalink to this definition">¶</a></dt> -<dd><div class="line-block"> -<div class="line"><span class="summaryline">finds which, and how many pixels in a surface are within a threshold of a color.</span></div> -<div class="line"><span class="signature">threshold(DestSurface, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = 1, Surface = None, inverse = False) -> num_threshold_pixels</span></div> -</div> -<p>Finds which, and how many pixels in a surface are within a threshold of a -color.</p> -<p>It can set the destination surface where all of the pixels not within the -threshold are changed to diff_color. If inverse is optionally set to True, -the pixels that are within the threshold are instead changed to diff_color.</p> -<p>If the optional second surface is given, it is used to threshold against -rather than the specified color. That is, it will find each pixel in the -first Surface that is within the threshold of the pixel at the same -coordinates of the second Surface.</p> -<p>If change_return is set to 0, it can be used to just count the number of -pixels within the threshold if you set</p> -<p>If change_return is set to 1, the pixels set in DestSurface will be those -from the color.</p> -<p>If change_return is set to 2, the pixels set in DestSurface will be those -from the first Surface.</p> -<p>You can use a threshold of (r,g,b,a) where the r,g,b can have different -thresholds. So you could use an r threshold of 40 and a blue threshold of 2 -if you like.</p> -<p>New in pygame 1.8</p> -</dd></dl> - -</dd></dl> - -</div> - - </div> - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="../genindex.html" title="General Index" - accesskey="I">index</a></li> - <li class="right" > - <a href="../filepaths.html" title="File Path Function Arguments" - accesskey="N">next</a> |</li> - <li class="right" > - <a href="time.html" title="pygame.time" - accesskey="P">previous</a> |</li> - <li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li> - <script type="text/javascript" src="jquery.plugin.docscomments.js"></script> - - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/search.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - - <title>Search — Pygame v1.9.2 documentation</title> - <link rel="stylesheet" href="_static/pygame.css" type="text/css" /> - <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '', - VERSION: '1.9.2', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true - }; - </script> - <script type="text/javascript" src="_static/jquery.js"></script> - <script type="text/javascript" src="_static/underscore.js"></script> - <script type="text/javascript" src="_static/doctools.js"></script> - <script type="text/javascript" src="_static/searchtools.js"></script> - <link rel="shortcut icon" href="_static/pygame.ico"/> - <link rel="top" title="Pygame v1.9.2 documentation" href="index.html" /> - <script type="text/javascript"> - jQuery(function() { Search.loadIndex("searchindex.js"); }); - </script> - - - </head> - <body> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - accesskey="I">index</a></li> - <li><a href="index.html">Pygame v1.9.2 documentation</a> »</li> - </ul> - </div> - - <div class="document"> - <div class="documentwrapper"> - <div class="body"> - - <h1 id="search-documentation">Search</h1> - <div id="fallback" class="admonition warning"> - <script type="text/javascript">$('#fallback').hide();</script> - <p> - Please activate JavaScript to enable the search - functionality. - </p> - </div> - <p> - From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. - </p> - <form action="" method="get"> - <input type="text" name="q" value="" /> - <input type="submit" value="search" /> - <span id="search-progress" style="padding-left: 10px"></span> - </form> - - <div id="search-results"> - - </div> - - </div> - </div> - <div class="clearer"></div> - </div> - <div class="related"> - <h3>Navigation</h3> - <ul> - <li class="right" style="margin-right: 10px"> - <a href="genindex.html" title="General Index" - >index</a></li> - <li><a href="index.html">Pygame v1.9.2 documentation</a> »</li> - </ul> - </div> - <div class="footer"> - © Copyright 2011, Pygame Developers. - </div> - </body> -</html> \ No newline at end of file
--- a/docs/searchindex.js Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -Search.setIndex({objects:{"":{pygame:[2,0,1]},"pygame.math.Vector2":{normalize:[1,1,1],slerp:[1,1,1],rotate:[1,1,1],length_squared:[1,1,1],lerp:[1,1,1],distance_squared_to:[1,1,1],angle_to:[1,1,1],distance_to:[1,1,1],cross:[1,1,1],reflect_ip:[1,1,1],reflect:[1,1,1],length:[1,1,1],normalize_ip:[1,1,1],scale_to_length:[1,1,1],is_normalized:[1,1,1],rotate_ip:[1,1,1],from_polar:[1,1,1],elementwise:[1,1,1],as_polar:[1,1,1],dot:[1,1,1]},"pygame.sprite.RenderUpdates":{draw:[9,1,1]},"pygame.examples.vgrade":{main:[3,4,1]},"pygame.mixer.Channel":{get_endevent:[20,1,1],pause:[20,1,1],set_endevent:[20,1,1],set_volume:[20,1,1],fadeout:[20,1,1],get_volume:[20,1,1],get_busy:[20,1,1],play:[20,1,1],queue:[20,1,1],get_queue:[20,1,1],get_sound:[20,1,1],stop:[20,1,1],unpause:[20,1,1]},"pygame.mask.Mask":{connected_components:[19,1,1],count:[19,1,1],draw:[19,1,1],overlap_area:[19,1,1],angle:[19,1,1],outline:[19,1,1],set_at:[19,1,1],invert:[19,1,1],overlap:[19,1,1],get_size:[19,1,1],erase:[19,1,1],convolve:[19,1,1],scale:[19,1,1],get_bounding_rects:[19,1,1],overlap_mask:[19,1,1],centroid:[19,1,1],get_at:[19,1,1],clear:[19,1,1],connected_component:[19,1,1],fill:[19,1,1]},"pygame.joystick":{get_count:[6,4,1],Joystick:[6,2,1],quit:[6,4,1],init:[6,4,1],get_init:[6,4,1]},"pygame.midi.Input":{read:[21,1,1],close:[21,1,1],poll:[21,1,1]},"pygame.sprite.LayeredDirty":{set_timing_treshold:[9,1,1],repaint_rect:[9,1,1],clear:[9,1,1],draw:[9,1,1],get_clip:[9,1,1],set_clip:[9,1,1],change_layer:[9,1,1]},"pygame.examples.testsprite":{main:[3,4,1]},"pygame.freetype.Font":{origin:[30,3,1],render:[30,1,1],oblique:[30,3,1],height:[30,3,1],render_raw_to:[30,1,1],underline_adjustment:[30,3,1],underline:[30,3,1],style:[30,3,1],strength:[30,3,1],get_sized_ascender:[30,3,1],get_sized_descender:[30,1,1],kerning:[30,3,1],pad:[30,3,1],fixed_width:[30,3,1],vertical:[30,3,1],ascender:[30,1,1],descender:[30,3,1],antialiased:[30,3,1],path:[30,3,1],strong:[30,3,1],render_to:[30,1,1],ucs4:[30,3,1],wide:[30,3,1],get_sized_height:[30,3,1],name:[30,3,1],get_rect:[30,1,1],get_metrics:[30,1,1],render_raw:[30,1,1],resolution:[30,3,1],get_sized_glyph_height:[30,1,1]},"pygame.mixer.music":{load:[34,4,1],play:[34,4,1],pause:[34,4,1],set_endevent:[34,4,1],set_volume:[34,4,1],get_pos:[34,4,1],get_busy:[34,4,1],get_volume:[34,4,1],set_pos:[34,4,1],get_endevent:[34,4,1],queue:[34,4,1],fadeout:[34,4,1],rewind:[34,4,1],stop:[34,4,1],unpause:[34,4,1]},"pygame.examples.chimp":{main:[3,4,1]},"pygame.camera.Camera":{get_raw:[31,1,1],get_image:[31,1,1],stop:[31,1,1],get_controls:[31,1,1],get_size:[31,1,1],start:[31,1,1],set_controls:[31,1,1],query_image:[31,1,1]},"pygame.mixer":{Sound:[20,2,1],quit:[20,4,1],pause:[20,4,1],get_num_channels:[20,4,1],fadeout:[20,4,1],set_reserved:[20,4,1],stop:[20,4,1],pre_init:[20,4,1],init:[20,4,1],music:[34,0,1],unpause:[20,4,1],find_channel:[20,4,1],get_busy:[20,4,1],set_num_channels:[20,4,1],Channel:[20,2,1],get_init:[20,4,1]},"pygame.examples.pixelarray":{main:[3,4,1]},"pygame.key":{name:[8,4,1],get_repeat:[8,4,1],get_focused:[8,4,1],get_mods:[8,4,1],set_mods:[8,4,1],get_pressed:[8,4,1],set_repeat:[8,4,1]},"pygame.sprite":{LayeredUpdates:[9,2,1],LayeredDirty:[9,2,1],Group:[9,2,1],collide_rect_ratio:[9,4,1],groupcollide:[9,4,1],collide_circle_ratio:[9,4,1],RenderPlain:[9,2,1],collide_circle:[9,4,1],collide_mask:[9,4,1],GroupSingle:[9,4,1],spritecollideany:[9,4,1],RenderUpdates:[9,2,1],OrderedUpdates:[9,4,1],spritecollide:[9,4,1],DirtySprite:[9,2,1],RenderClear:[9,2,1],collide_rect:[9,4,1],Sprite:[9,2,1]},"pygame.examples.overlay":{main:[3,4,1]},"pygame.examples.blit_blends":{main:[3,4,1]},"pygame.examples.liquid":{main:[3,4,1]},"pygame.cdrom.CD":{get_track_start:[29,1,1],quit:[29,1,1],play:[29,1,1],pause:[29,1,1],get_init:[29,1,1],eject:[29,1,1],get_all:[29,1,1],get_numtracks:[29,1,1],stop:[29,1,1],resume:[29,1,1],get_busy:[29,1,1],get_id:[29,1,1],get_name:[29,1,1],get_track_length:[29,1,1],init:[29,1,1],get_track_audio:[29,1,1],get_paused:[29,1,1],get_current:[29,1,1],get_empty:[29,1,1]},"pygame.movie.Movie":{get_length:[24,1,1],play:[24,1,1],pause:[24,1,1],set_volume:[24,1,1],stop:[24,1,1],has_audio:[24,1,1],rewind:[24,1,1],get_busy:[24,1,1],has_video:[24,1,1],get_size:[24,1,1],set_display:[24,1,1],render_frame:[24,1,1],get_frame:[24,1,1],get_time:[24,1,1],skip:[24,1,1]},"pygame.examples.headless_no_windows_needed":{main:[3,4,1]},"pygame.Color":{hsva:[23,3,1],normalize:[23,1,1],hsla:[23,3,1],b:[23,3,1],correct_gamma:[23,1,1],g:[23,3,1],i1i2i3:[23,3,1],r:[23,3,1],a:[23,3,1],cmy:[23,3,1],set_length:[23,1,1]},"pygame.camera":{list_cameras:[31,4,1],colorspace:[31,4,1],Camera:[31,2,1]},"pygame.mask":{from_surface:[19,4,1],Mask:[19,2,1],from_threshold:[19,4,1]},"pygame.font.Font":{set_underline:[7,1,1],get_height:[7,1,1],set_bold:[7,1,1],render:[7,1,1],get_underline:[7,1,1],get_bold:[7,1,1],metrics:[7,1,1],get_italic:[7,1,1],get_descent:[7,1,1],get_linesize:[7,1,1],get_ascent:[7,1,1],set_italic:[7,1,1],size:[7,1,1]},"pygame.draw":{aaline:[16,4,1],polygon:[16,4,1],lines:[16,4,1],circle:[16,4,1],arc:[16,4,1],aalines:[16,4,1],line:[16,4,1],ellipse:[16,4,1],rect:[16,4,1]},"pygame.midi":{quit:[21,4,1],MidiException:[21,4,1],get_device_info:[21,4,1],Output:[21,2,1],time:[21,4,1],get_default_input_id:[21,4,1],init:[21,4,1],midis2events:[21,4,1],Input:[21,2,1],get_count:[21,4,1],get_default_output_id:[21,4,1]},"pygame.Overlay":{get_hardware:[33,1,1],display:[33,1,1],set_location:[33,1,1]},"pygame.gfxdraw":{aapolygon:[17,4,1],aacircle:[17,4,1],aaellipse:[17,4,1],pie:[17,4,1],filled_trigon:[17,4,1],hline:[17,4,1],vline:[17,4,1],textured_polygon:[17,4,1],ellipse:[17,4,1],filled_ellipse:[17,4,1],polygon:[17,4,1],bezier:[17,4,1],circle:[17,4,1],pixel:[17,4,1],rectangle:[17,4,1],filled_polygon:[17,4,1],line:[17,4,1],filled_circle:[17,4,1],box:[17,4,1],aatrigon:[17,4,1],trigon:[17,4,1],arc:[17,4,1]},"pygame.transform":{average_surfaces:[28,4,1],get_smoothscale_backend:[28,4,1],rotate:[28,4,1],average_color:[28,4,1],flip:[28,4,1],laplacian:[28,4,1],rotozoom:[28,4,1],chop:[28,4,1],scale:[28,4,1],set_smoothscale_backend:[28,4,1],threshold:[28,4,1],smoothscale:[28,4,1],scale2x:[28,4,1]},pygame:{surfarray:[26,0,1],Overlay:[33,2,1],image:[32,0,1],tests:[27,0,1],encode_string:[2,4,1],get_sdl_version:[2,4,1],examples:[3,0,1],cursors:[18,0,1],font:[7,0,1],mouse:[14,0,1],event:[4,0,1],locals:[35,0,1],quit:[2,4,1],encode_file_path:[2,4,1],freetype:[30,0,1],Surface:[36,2,1],movie:[24,0,1],scrap:[12,0,1],gfxdraw:[17,0,1],transform:[28,0,1],PixelArray:[11,2,1],init:[2,4,1],version:[2,0,1],register_quit:[2,4,1],pixelcopy:[22,0,1],draw:[16,0,1],sprite:[9,0,1],camera:[31,0,1],error:[2,6,1],sndarray:[10,0,1],key:[8,0,1],cdrom:[29,0,1],midi:[21,0,1],Color:[23,2,1],set_error:[2,4,1],Rect:[13,2,1],mask:[19,0,1],mixer:[20,0,1],get_sdl_byteorder:[2,4,1],math:[1,0,1],get_error:[2,4,1],time:[25,0,1],joystick:[6,0,1],display:[0,0,1]},"pygame.examples.scaletest":{main:[3,4,1]},"pygame.examples.sound":{main:[3,4,1]},"pygame.examples.eventlist":{main:[3,4,1]},"pygame.Surface":{map_rgb:[36,1,1],get_view:[36,1,1],set_palette_at:[36,1,1],lock:[36,1,1],get_locked:[36,1,1],get_locks:[36,1,1],get_at_mapped:[36,1,1],unlock:[36,1,1],blit:[36,1,1],get_abs_offset:[36,1,1],get_losses:[36,1,1],get_bounding_rect:[36,1,1],get_bytesize:[36,1,1],fill:[36,1,1],get_size:[36,1,1],mustlock:[36,1,1],copy:[36,1,1],get_bitsize:[36,1,1],get_abs_parent:[36,1,1],get_flags:[36,1,1],get_masks:[36,1,1],get_height:[36,1,1],subsurface:[36,1,1],unmap_rgb:[36,1,1],get_colorkey:[36,1,1],set_colorkey:[36,1,1],get_at:[36,1,1],convert_alpha:[36,1,1],set_at:[36,1,1],get_palette:[36,1,1],get_parent:[36,1,1],get_palette_at:[36,1,1],set_palette:[36,1,1],get_offset:[36,1,1],get_shifts:[36,1,1],set_masks:[36,1,1],get_alpha:[36,1,1],get_buffer:[36,1,1],set_shifts:[36,1,1],convert:[36,1,1],set_alpha:[36,1,1],get_pitch:[36,1,1],get_rect:[36,1,1],get_width:[36,1,1],set_clip:[36,1,1],scroll:[36,1,1],get_clip:[36,1,1]},"pygame.tests":{run:[27,4,1]},"pygame.examples.midi":{main:[3,4,1]},"pygame.examples.movieplayer":{main:[3,4,1]},"pygame.examples.camera":{main:[3,4,1]},"pygame.examples.scrap_clipboard":{main:[3,4,1]},"pygame.examples.blend_fill":{main:[3,4,1]},"pygame.event":{get_grab:[4,4,1],set_blocked:[4,4,1],get:[4,4,1],event_name:[4,4,1],clear:[4,4,1],peek:[4,4,1],pump:[4,4,1],set_allowed:[4,4,1],set_grab:[4,4,1],post:[4,4,1],poll:[4,4,1],Event:[4,4,1],get_blocked:[4,4,1],wait:[4,4,1]},"pygame.scrap":{get_types:[12,4,1],lost:[12,4,1],set_mode:[12,4,1],get:[12,4,1],contains:[12,4,1],init:[12,4,1],put:[12,4,1]},"pygame.examples.arraydemo":{main:[3,4,1]},"pygame.time":{delay:[25,4,1],get_ticks:[25,4,1],set_timer:[25,4,1],wait:[25,4,1],Clock:[25,2,1]},"pygame.examples.aliens":{main:[3,4,1]},"pygame.sprite.Group":{draw:[9,1,1],copy:[9,1,1],clear:[9,1,1],update:[9,1,1],remove:[9,1,1],add:[9,1,1],has:[9,1,1],sprites:[9,1,1],empty:[9,1,1]},"pygame.cursors":{compile:[18,4,1],load_xbm:[18,4,1]},"pygame.mixer.Sound":{get_length:[20,1,1],play:[20,1,1],set_volume:[20,1,1],fadeout:[20,1,1],get_volume:[20,1,1],stop:[20,1,1],get_num_channels:[20,1,1],get_buffer:[20,1,1]},"pygame.examples.oldalien":{main:[3,4,1]},"pygame.examples.scroll":{main:[3,4,1]},"pygame.Rect":{move:[13,1,1],unionall_ip:[13,1,1],copy:[13,1,1],collidelist:[13,1,1],clip:[13,1,1],fit:[13,1,1],union:[13,1,1],inflate_ip:[13,1,1],move_ip:[13,1,1],contains:[13,1,1],collidepoint:[13,1,1],collidedictall:[13,1,1],normalize:[13,1,1],collidelistall:[13,1,1],clamp:[13,1,1],inflate:[13,1,1],union_ip:[13,1,1],clamp_ip:[13,1,1],collidedict:[13,1,1],unionall:[13,1,1],colliderect:[13,1,1]},"pygame.sprite.Sprite":{update:[9,1,1],alive:[9,1,1],add:[9,1,1],kill:[9,1,1],remove:[9,1,1],groups:[9,1,1]},"pygame.movie":{Movie:[24,2,1]},"pygame.examples.fastevents":{main:[3,4,1]},"pygame.freetype":{quit:[30,4,1],get_default_font:[30,4,1],get_version:[30,4,1],set_default_resolution:[30,4,1],init:[30,4,1],get_error:[30,4,1],get_default_resolution:[30,4,1],Font:[30,2,1],was_init:[30,4,1]},"pygame.mouse":{get_rel:[14,4,1],set_visible:[14,4,1],get_focused:[14,4,1],set_pos:[14,4,1],get_pos:[14,4,1],set_cursor:[14,4,1],get_pressed:[14,4,1],get_cursor:[14,4,1]},"pygame.pixelcopy":{map_array:[22,4,1],make_surface:[22,4,1],surface_to_array:[22,4,1],array_to_surface:[22,4,1]},"pygame.examples.glcube":{main:[3,4,1]},"pygame.surfarray":{array_alpha:[26,4,1],pixels_green:[26,4,1],pixels2d:[26,4,1],use_arraytype:[26,4,1],array3d:[26,4,1],pixels_alpha:[26,4,1],array_colorkey:[26,4,1],make_surface:[26,4,1],array2d:[26,4,1],blit_array:[26,4,1],pixels_blue:[26,4,1],pixels_red:[26,4,1],map_array:[26,4,1],get_arraytype:[26,4,1],pixels3d:[26,4,1],get_arraytypes:[26,4,1]},"pygame.time.Clock":{tick_busy_loop:[25,1,1],get_time:[25,1,1],tick:[25,1,1],get_fps:[25,1,1],get_rawtime:[25,1,1]},"pygame.cdrom":{quit:[29,4,1],init:[29,4,1],get_count:[29,4,1],get_init:[29,4,1],CD:[29,2,1]},"pygame.font":{quit:[7,4,1],get_default_font:[7,4,1],Font:[7,2,1],get_init:[7,4,1],get_fonts:[7,4,1],init:[7,4,1],match_font:[7,4,1],SysFont:[7,4,1]},"pygame.sprite.LayeredUpdates":{layers:[9,1,1],get_layer_of_sprite:[9,1,1],draw:[9,1,1],get_sprites_at:[9,1,1],get_top_sprite:[9,1,1],remove_sprites_of_layer:[9,1,1],get_sprite:[9,1,1],switch_layer:[9,1,1],get_bottom_layer:[9,1,1],move_to_back:[9,1,1],get_top_layer:[9,1,1],add:[9,1,1],move_to_front:[9,1,1],get_sprites_from_layer:[9,1,1],sprites:[9,1,1],change_layer:[9,1,1]},"pygame.PixelArray":{ndim:[11,3,1],compare:[11,1,1],transpose:[11,1,1],make_surface:[11,1,1],surface:[11,3,1],replace:[11,1,1],strides:[11,3,1],shape:[11,3,1],itemsize:[11,3,1],extract:[11,1,1]},"pygame.examples.stars":{main:[3,4,1]},"pygame.math.Vector3":{length_squared:[1,1,1],distance_to:[1,1,1],distance_squared_to:[1,1,1],elementwise:[1,1,1],normalize:[1,1,1],slerp:[1,1,1],as_spherical:[1,1,1],cross:[1,1,1],rotate_x_ip:[1,1,1],rotate_y_ip:[1,1,1],is_normalized:[1,1,1],from_spherical:[1,1,1],lerp:[1,1,1],reflect_ip:[1,1,1],reflect:[1,1,1],rotate_ip:[1,1,1],rotate_x:[1,1,1],rotate_y:[1,1,1],rotate_z:[1,1,1],rotate:[1,1,1],rotate_z_ip:[1,1,1],angle_to:[1,1,1],scale_to_length:[1,1,1],length:[1,1,1],normalize_ip:[1,1,1],dot:[1,1,1]},"pygame.image":{load:[32,4,1],frombuffer:[32,4,1],get_extended:[32,4,1],fromstring:[32,4,1],tostring:[32,4,1],save:[32,4,1]},"pygame.version":{ver:[2,5,1],vernum:[2,5,1]},"pygame.examples.cursors":{main:[3,4,1]},"pygame.examples.moveit":{main:[3,4,1]},"pygame.examples.fonty":{main:[3,4,1]},"pygame.examples.mask":{main:[3,4,1]},"pygame.display":{get_caption:[0,4,1],mode_ok:[0,4,1],set_icon:[0,4,1],get_active:[0,4,1],iconify:[0,4,1],quit:[0,4,1],set_palette:[0,4,1],set_mode:[0,4,1],set_gamma:[0,4,1],get_wm_info:[0,4,1],init:[0,4,1],set_gamma_ramp:[0,4,1],Info:[0,4,1],get_surface:[0,4,1],update:[0,4,1],toggle_fullscreen:[0,4,1],get_driver:[0,4,1],set_caption:[0,4,1],get_init:[0,4,1],flip:[0,4,1],gl_get_attribute:[0,4,1],gl_set_attribute:[0,4,1],list_modes:[0,4,1]},"pygame.joystick.Joystick":{quit:[6,1,1],get_hat:[6,1,1],get_numbuttons:[6,1,1],init:[6,1,1],get_name:[6,1,1],get_ball:[6,1,1],get_id:[6,1,1],get_axis:[6,1,1],get_button:[6,1,1],get_numhats:[6,1,1],get_numaxes:[6,1,1],get_numballs:[6,1,1],get_init:[6,1,1]},"pygame.sndarray":{use_arraytype:[10,4,1],samples:[10,4,1],make_sound:[10,4,1],array:[10,4,1],get_arraytype:[10,4,1],get_arraytypes:[10,4,1]},"pygame.examples.sound_array_demos":{main:[3,4,1]},"pygame.math":{Vector2:[1,2,1],disable_swizzling:[1,4,1],Vector3:[1,2,1],enable_swizzling:[1,4,1]},"pygame.midi.Output":{write_short:[21,1,1],write:[21,1,1],write_sys_ex:[21,1,1],note_off:[21,1,1],abort:[21,1,1],set_instrument:[21,1,1],close:[21,1,1],note_on:[21,1,1]}},terms:{kmod_rmeta:8,renturn:[],num_devic:21,four:[26,29,0],joyaxismot:[6,4],sleep:[25,4],fout:3,namehint:32,whose:30,lgpl:5,own_data_typ:12,k_kp0:8,swap:[11,13,0],under:[5,21,14,0],sped:16,clockwis:28,merchant:31,digit:[23,6],everi:[5,20,29,9,8,19,28,1,25,34,3,26,36],blanket:[22,36],affect:[20,9,30,11,26,2,13,16,36],recommended_output_devic:21,showcas:3,frozen:27,vector:1,get_button:6,cmy:23,though:[20,22,13,27,17,31],initialis:[6,21],get_num_channel:20,chew:25,bitstream:7,seper:2,direct:[20,0,22,19,1,11,3,36,31],sourceforg:[],second:[28,20,29,24,1,25,10,11,27,34,3,18],xf0:21,sysfont:[30,7],xf7:21,even:[24,7,0,30,15,25,10,11,2,29,3,26,31],mpeg:[5,24,3],hide:14,set_control:31,introspect:22,set_ital:7,get_track_audio:29,"new":[0,1,2,3,4,6,7,8,9,10,11,12,13,14,26,17,19,20,21,22,23,24,25,28,30,31,32,34,36],net:[],ever:[21,34],get_extend:32,portmidi:21,widget:3,behavior:9,lerp:1,never:[20,34,25,14,6,36],etyp:2,here:[20,9,0,33,3,36,31,4],met:31,typeerror:[22,7],path:[5,7,30,3,1,32,2,27,15],union_ip:13,uxxxxxxxx:[30,15],interpret:[30,2,15,3],"_use_upd":9,items:11,anymor:[12,11],precis:[36,20,0],bitmask:[8,19,36,14,9],permit:[31,15],get_width:36,mime:12,portabl:21,numpass:2,from_surfac:[19,9],"_test":27,linearli:36,truetyp:[5,7],substr:21,unix:[18,0],blend_add:36,"0x80000000":36,txt:[],argb:32,unit:[30,36,2,27,7],highli:36,describ:[21,14,0],would:[20,9,36,19,1,2,28,18],trackbal:6,music:[5,20,34,3],python26:3,recommend:[9,4,36,7,0],strike:30,type:[5,28,6,7,0,30,9,25,10,11,12,33,2,35,32,34,15,26,20,36,4],until:[21,0,1,25,34,31,4],rgbvalu:23,activeev:[4,0],gl_accum_red_s:0,successful:0,relat:[30,35],notic:[13,31],yoffset:19,warn:[26,2,10],exce:36,repcolor:11,hold:[28,6,7,9],unpack:23,slowest:36,must:[9,1,4,6,7,0,10,11,12,14,26,18,31,20,21,22,24,16,27,28,30,32,33,29,36],join:[32,13],videoexpos:[4,0],restor:0,setup:3,work:[0,3,4,6,7,8,9,10,12,13,14,26,17,18,20,21,22,19,16,27,28,30,32,29,36],average_surfac:28,root:[27,1],shredwheat:[],obliqu:30,overrid:9,rectangle_list:0,give:[6,21,9,30,11,36],indic:[21,9,10,11,13,14,26,27],get_track_start:29,hline:17,unavail:[7,0],want:[6,0,8,23,9,1,25,32,2,28,36,4],sizer_xy_str:18,type1:30,smoothscal:[28,3],end:[20,29,9,8,32,2,34,16,17,4],k_clear:8,quot:8,default_cache_s:[],i686:28,how:[5,28,24,20,29,9,8,19,15,1,25,30,2,34,3,36],playback:[5,20,34,24,29,3],sever:[5,20,9,30,0,25,13,3,16,17,18],rewind:[24,34],verifi:0,perspect:3,updat:[33,9,25,0],hsla:23,recogn:[22,30,7,28],after:[24,20,21,9,8,29,0,10,32,30,34,6,36],befor:[24,6,7,9,8,29,0,25,12,30,27,36,14,20,17,18,31,21],wrong:20,set_clip:[36,9],set_shift:36,demonstr:[5,3],luma:31,andmask:14,attempt:[31,24,36,7,21],blitzbas:3,third:1,interpol:1,opaqu:[22,26,19,36],obsolet:36,exclud:[36,27],alias:[16,5,17,30],unpaus:[20,29,34],maintain:[2,13,7,9],green:[0,23,11,26,36,31],frequent:6,enter:[8,7,14],exclus:[36,21],order:[20,21,9,8,25,11,2,27,34,36],oper:[28,24,9,8,30,23,0,1,11,12,26,2,13,15,16,36,4],composit:8,set_palette_at:36,over:[20,9,30,24,11,0,34,18],failur:27,becaus:[30,36,1,21,9],jpeg:32,get_typ:12,get_asc:7,keyboard:[5,8,35,14,3,4],flexibl:5,numpixel:19,encode_file_path:2,midi_event_list:21,fit:[30,20,13,31,36],fbcon:0,fix:[30,36,28],get_bits:36,better:[21,0,28,14,3,34,36,7],get_numax:6,fade:[20,34,3],hidden:[14,0],get_numbal:6,easier:[9,13,3],descend:30,gl_stereo:0,them:[5,20,9,8,36,10,11,32,26,3,16,18,4],anim:[32,5,28,9,3],thei:[28,24,6,7,0,8,29,9,1,30,2,36,14,3,16,20,18,4],blit_arrai:[22,26],safe:[6,7,9,30,21,0,11,2,29,20,36,4],k_mode:8,rectangl:[5,28,24,7,9,30,0,13,3,16,17,36],get_rawtim:25,"break":[8,10,12,26,17,31],lenth:29,interrupt:31,choic:[20,0],repaint:[9,4],subsubsurfac:36,new_lay:9,fonti:3,"1x1":21,unicode_escap:2,arrow:[8,18,3],each:[28,6,7,0,30,19,9,1,10,11,12,27,29,3,26,20,17,36,31,4],debug:[28,4],side:[16,11,13,0],mean:[24,6,34,9,8,30,0,1,12,22,14,28,20,17],k_space:8,resum:[24,20,29,34],accler:0,topright:13,logo:0,extract:[28,11],x86:28,gradient:[19,3],content:[12,33,11,35,0],adapt:[],got:24,unrecogn:[32,7],forth:[],face_index:[],chimpanze:5,linear:[9,1,0],situat:[36,0],free:3,standard:[9,22,33,2,18,4],pbm:[12,32],int_valu:36,element:[21,22,23,1,10,11,30,36],midleft:13,get_alpha:36,topleft:[36,28,11,13,9],ata:21,angl:[16,19,1,28],filter:[5,19,28,4],isn:[29,3],onto:[7,9,30,19,17,36],rang:[6,21,9,30,23,0,1,11],render:[5,24,7,9,30,0,33,3,16,36],independ:[],get_control:31,restrict:36,laggi:20,unlik:[22,36],alreadi:[6,21,9,29,0,13,34,16,20,17],set_cursor:[18,14],textured_polygon:17,thick:[16,7],primari:14,fin:3,k_pagedown:8,top:[5,24,20,7,9,30,19,0,32,2,13,14,3,36],sometim:[18,0],tango:30,stack:4,get_buff:[36,20],gl_multisamplesampl:0,underlin:[30,7],too:[27,9,13,36,4],rect2:13,rect1:13,k_at:8,consol:[27,3],namespac:35,tool:3,somewhat:3,"_default_lay":9,kmod_ctrl:8,layer1_nr:9,conveni:[2,27,9],target:[22,24,11,13,9],keyword:[5,20,2,27,3,36,31,4],provid:[5,28,20,7,0,30,9,1,25,11,33,2,13,3,27,36,31],set_error:2,k_minu:8,project:3,matter:36,normalize_ip:1,tranpar:26,"10th":19,mini:7,uniniti:[20,21,0,24,2,29,6,31,7],load_xbm:18,convert_alpha:[32,36,3],runner:27,mind:[16,26,17,25,10],from_polar:1,minx:7,raw:[22,32,36,11],seed:27,increment:28,miniatur:6,seen:0,numlock:8,lbm:32,minu:8,vgl:0,maxx:7,strength:30,recreat:[27,3],especi:30,maxi:7,k_kp_plu:8,fname:3,posn:[],data3:21,data2:21,blue:[7,0,23,11,28,26,36,31],copi:[32,20,9,22,28,10,11,12,13,3,26,36],shall:31,object:[0,2,3,4,5,6,7,9,10,11,13,16,17,18,19,20,29,22,23,24,25,30,32,33,34,36],current_h:0,current_w:0,regular:[5,7,9,0,33,2,34,28,16,36,4],letter:[36,7,29],grave:8,type42:30,webcam:31,"0x00000000":36,"0x00000001":36,don:[30,9,21,25,3],rect_sequ:13,doc:[36,9],doe:[9,2,3,21,7,8,0,12,13,26,17,18,20,29,22,19,25,16,28,33,34,36],blend_fil:3,get_rect:[30,36],bracket:8,neg:[20,30,19,1,11,13,28,36],k_menu:8,unchang:15,came:[32,3],prim:[],bottomright:[17,13],opposit:4,random:27,set_vis:14,set_timing_treshold:9,radiu:[16,17,9],radii:17,protocol:22,make:[5,6,9,19,24,25,11,12,13,3,20,36,4],involv:[30,5,36,3],absolut:[6,21,30,23,29,36],textdecod:[],layout:[30,7],acquir:[12,36,20],spite:9,menu:8,explain:35,configur:[30,5,14],busi:[20,25,29,31],bottomleft:13,intersect:[19,13,9],layer2_nr:9,stop:[14,20,34,24,29,31],own_data:12,report:[6,3,24,1,28,4],sizer_x_str:18,emb:0,boarder:17,k_hash:8,twice:[28,9],sauf:19,respond:4,keypad:8,encode_str:2,get_device_info:21,result:[21,30,1,11,27,28,7],query_imag:31,fail:[7,30,24,12,2,27,4],hash:8,best:[20,0,22,19,25,3,26,36,4],pete:[],awar:[7,0,2,13,34,4],subarrai:11,scrap:[12,5],collidedict:13,score:3,elementwis:1,drawn:[9,30,19,24,0,16,36],dissapear:[12,17],attribut:[6,9,8,35,0,30,13,14,27,17,36,4],get_length:[24,20],accord:22,triplet:[16,17,0],extend:[32,9],extens:[32,28],toler:6,midisport:21,protect:3,fnt:30,framebuff:0,hashabl:13,howev:[9,30,3,11,12,35,28,31],against:[13,28],get_raw:31,yv12_overlai:33,col:17,kwd:27,had:36,height:[28,7,0,30,19,24,11,32,33,13,14,3,36,31],exemplari:31,collidelist:13,guid:5,assum:[30,7,21],duplic:[36,9],liabil:31,orderedupd:9,strong:30,union:13,style_default:30,mizuno:31,sdl_ttf:[30,7],numpi:[5,22,10,11,3,26,36],three:[26,20,2,1,36],been:[6,29,9,30,36,0,1,2,34,20,18,4],unnot:8,much:[7,19,3,25,32,28],interest:[12,4],basic:[5,24,9,23,0,12,3,31],clear_callback:9,quickli:32,k_f1:8,k_f2:8,k_f3:8,k_f4:8,sprite:[5,9,3],k_f6:8,k_f7:8,k_f8:8,k_f9:8,xxx:18,get_imag:31,argument:[0,1,2,3,4,5,6,7,8,9,13,14,15,16,17,18,31,20,29,22,24,25,27,28,30,32,33,34,36],bitstreamverasan:7,k_kp8:8,k_kp9:8,child:36,cdrom:[5,29],k_kp5:8,k_kp6:8,note_on:21,spin:3,k_kp1:8,k_kp2:8,k_kp3:8,ident:[11,4],shrink:13,servic:31,properti:[26,9],commerci:5,counterclockwis:[1,28],calcul:[30,19,11,1,9],khz:10,aapolygon:[16,17],scrap_bmp:12,get_default_output_id:21,player:[9,3],kwarg:[36,9],disappear:31,k_dollar:8,descent:[30,7],perform:[28,20,7,9,30,19,0,1,11,3,36,4],suggest:[1,11],"0xd800":30,format:[33,20,0,22,30,23,24,10,11,32,26,2,36,34,28,16,17,18,31],pixelformat:31,complex:20,split:18,synch:4,big_endian:2,complet:[20,9,8,10,13,26,36],wheel:14,hand:[22,11],fairli:9,rais:[32,28,24,20,7,9,22,0,1,10,12,30,2,14,15,26,34,36,21],tune:30,squar:[16,1],renderupd:[9,3],thu:[12,1,11],inherit:[36,9],midright:13,thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],filled_ellips:17,everyth:[22,24,2,4],left:[6,9,8,19,0,30,13,14,20,36],identifi:[8,12,6,4],just:[33,20,9,30,19,28,26,27,34,3,16,17,36,4],spriteleft:9,set_smoothscale_backend:28,memoryview:36,yet:30,languag:3,previous:[23,2,31],"0x00000010":36,easi:[24,3],character:1,get_numbutton:6,"0x00010000":36,reiniti:[30,24,20],els:[12,22,2,30],save:[32,5,31],hat:[6,4],applic:[20,21,12,35,3,36,4],mayb:[3,0],preserv:[36,13],move_to_front:9,background:[20,7,9,30,24,3],k_kp_divid:8,k_equal:8,u0001:7,specif:[20,7,9,8,30,0,12,22,36,4],arbitrari:[28,9],sprite_dict:9,manual:[30,2,36,7],zoom:3,rect_list:9,set_allow:4,crossbar:3,scaletest:3,underli:[30,21],www:[],right:[6,9,8,19,0,11,13,16,20,17,36],old:[9,0],deal:[8,2],interv:[8,4],layereddirti:9,intern:[20,0,12,2,36,4],get_clip:[36,9],inact:20,"0x40000000":36,transmiss:21,slerp:1,sound_array_demo:3,cooper:29,bottom:[7,9,30,32,13,3,17],subclass:[13,9],multipli:[8,30,28,1,11],equal:[8,36,23,18,4],condit:[20,31],cord:3,peek:4,plu:[8,30,7,21],bold:[30,7],uncompress:[32,20],compress:36,hsl:23,acolor:23,dirtysprit:9,sn9c101:31,scrollabl:3,hat_numb:6,fileobj:32,k_rsuper:8,pyunicode_asencodedstr:2,post:[20,4],srccolorkei:36,"super":3,pysdl:[],obj:2,gl_accum_blue_s:0,slightli:[23,4,36,25,3],surround:28,unfortun:27,k_return:8,breakag:11,produc:30,videores:[4,0],destsurfac:[31,28],get_capt:0,encod:[7,30,36,24,12,2,15,18],bound:[16,30,19,36,9],ppm:[12,32],down:[6,0,8,30,2,14,36],pair:[6,7,0,30,19,32,13,36],vline:17,wrap:[17,36,11],get_view:36,blend_rgba_min:36,accordingli:30,get_ital:7,wai:[20,7,9,8,30,32,22,2,27,14,3,31,4],support:[9,1,2,3,4,0,10,11,12,26,18,31,20,21,22,23,28,30,32,33,34,36],transform:[30,5,31,28],avail:[32,20,7,0,30,28,10,12,33,2,27,3,26,17,36,31,21],width:[28,7,0,30,36,19,24,11,32,33,13,14,3,16,18,31],fraction:30,get_flag:36,gil:17,lowest:21,creation:[26,10],autonom:3,form:[31,23,36,21,4],offer:[4,2,18,0],forc:[20,3],noevent:[20,34,4],"true":[0,1,2,3,4,6,7,8,9,12,13,14,16,31,20,21,24,27,28,29,30,32,33,34,36],toggle_fullscreen:0,reset:[30,20,21,34,9],xxxx_test:27,maximum:[30,7],tell:20,othersurfac:19,maskfil:18,botton:9,minor:2,"0x00002000":36,starfield:3,vectorelementwizeproxi:1,featur:[5,7,9,30,19,2,36],get_focus:[8,14],semicolon:8,get_sized_ascend:30,fromstr:32,subsurfac:[36,28],exist:[6,7,9,30,0,29,16,36,31,4],request:[7,0,19,10,3,26,36],indirect:31,endcap:[16,17],assembl:8,readonli:[9,4],groupcollid:9,keyup:[8,35,4],when:[0,2,3,4,6,7,8,9,10,11,12,13,14,26,31,20,21,23,24,27,29,30,32,33,34,36],i1i2i3:23,test:[5,33,6,7,9,8,19,28,1,27,32,30,2,13,29,3,20,36,4],tif:32,roll:[6,14],lil_endian:2,intend:[22,9,36,3],scratchi:20,asterisk:8,insensit:[22,36],consid:[9,30,24,2,13,34,28,36],forcibl:20,get_hardwar:33,euclidian:11,uffff:[7,15],fastev:[4,3],receiv:[8,6,14,0],faster:[9,3,1,32,28,26],duron:3,advancemam:28,ignor:[36,27,20,21],time:[5,28,24,20,7,0,30,29,21,9,35,25,10,2,27,14,3,34,36,31,4],push:8,backward:[22,30,24,20,4],osx:[12,21],concept:5,set_block:4,skip:[19,24,20,0],oss:21,global:[27,1],get_default_input_id:21,signific:36,row:[36,11],millisecond:[20,21,9,8,25,34],decid:4,middl:14,depend:[32,20,7,0,22,10,11,12,30,34,15,4],flash:5,readabl:20,render_to:30,match_font:7,vec:1,centroid:19,x00:[7,15],special_flag:[36,9],sourc:[5,20,21,9,22,28,11,32,3,36,31],string:[0,2,4,6,7,8,10,12,15,26,18,31,20,21,23,27,28,30,32,33,29,36],submodul:[2,27],word:12,run_test:27,exact:[32,23,0],scrap_select:12,sloppi:3,layer2:9,colorkei:[7,0,22,3,32,30,28,26,36],swizzl:1,"0x00000020":36,num_threshold_pixel:28,level:[5,20,21,0,33,2,27,28,36,7],did:31,iter:[11,9],item:[22,11,9,30,4],sdl_video:36,unsupport:[31,34],quick:[36,4,27,3],k_up:8,get_smoothscale_backend:28,round:[16,23,20],prevent:4,slower:[16,36,25,9],sign:[8,26,20,10],blend_sub:36,group1:9,group2:9,gl_alpha_s:0,port:[21,3],colormap:[22,26,3],comparis:11,pygaqm:[],horizontal_advance_i:30,appear:[5,4,25,3],vector2:1,vector3:1,current:[0,1,2,3,4,6,7,9,10,11,12,13,14,26,31,20,21,24,27,28,29,30,33,34,36],urfac:22,horizontal_advance_x:30,ampersand:8,file_path:3,antialia:7,deriv:[9,24,2,3],blend_min:36,gener:[5,6,21,0,8,28,1,11,32,22,14,3,26,36],reflect_ip:1,disclaim:31,explicitli:[30,11],modif:[36,31],along:[27,13,21,3],xoffset:19,wait:[6,21,0,25,14,4],box:[16,30,17],shift:[0,8,19,11,3,36],is_norm:1,queue:[6,34,0,8,25,14,3,20,31,4],behav:[26,10],overriden:[],extrem:3,coremidi:21,takafumi:31,gamepad:6,extra:[36,20,9],modul:[0,1,2,3,4,5,6,7,8,9,10,11,12,14,16,17,18,31,20,21,22,19,24,25,26,27,28,29,30,32,34,35,36],kmod_lshift:8,prefer:[32,17],forev:24,leav:36,fake:[27,7,3],instal:[26,5,10,3],register_quit:2,memori:[26,30,36,0],collide_circle_ratio:9,screencoordin:9,error_msg:2,live:[5,3],handler:4,msg:21,black:[36,11,18,14,3],diff_color:28,from_spher:1,peopl:[5,3],finit:19,enhanc:[30,5,7],examin:5,set_colorkei:[22,36],easiest:3,underline_adjust:30,get_init:[20,7,0,10,29,6],fly:13,graphic:[33,24,3,28,0],windowsxp:3,prepar:[34,3],focu:[8,4,14,0],k_backslash:8,userev:[20,25,4],can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],style_non:30,purpos:31,problemat:[24,3],backspac:8,stream:[5,24,20,21,34],vernum:2,k_rshift:8,backslash:8,topic:5,stroke:16,abort:21,find_channel:20,occur:[30,20,21,11],orgin:13,alwai:[28,24,6,7,0,30,9,25,10,32,33,2,14,3,36,31,4],multipl:[28,6,7,0,8,29,9,33,14,3,16,20,36,4],unsign:[26,36,20,10],charset:12,bgr:36,write:[30,36,21,3],pure:36,get_bytes:[36,11],map:[22,23,11,26,16,17,36],product:1,max:21,sp2:3,usabl:[12,32],mac:[12,3],mai:[32,6,21,0,22,23,24,27,31,12,30,2,13,29,3,20,17,36,19,4],underscor:8,get_sdl_byteord:2,data:[5,20,21,22,36,28,10,12,33,32,14,3,26,29,18,31,4],grow:13,"0x10000":30,stress:3,liquid:3,"0x00001000":36,explicit:[22,0],inform:[5,6,7,0,1,2,27,14,29,36,21],"switch":[9,0],combin:[36,28,13,0],block:[36,31,34,4],callabl:[2,9],remove_sprites_of_lay:9,v4l2:31,get_axi:6,endev:[20,34],anticip:2,"0xff00ff":11,surfarrai:[22,5,26,36,3],pitch:36,nondestruct:28,still:[20,0,22,1,32,36],mainli:[36,7],ttf:[30,7],group:[9,3],monitor:[25,0],get_shift:36,activili:20,platform:[5,20,21,0,8,25,12,33,27,16,17,4],window:[5,21,0,8,24,12,30,35,14,3,36,4],rleaccelok:36,main:[9,22,24,33,27,3,4],bounc:[28,1,3],set_palett:[36,0],non:[9,30,11,32,3,36],"float":[6,29,9,30,23,24,1,25,34,28,16],chimp:[5,3],initi:[5,6,7,0,8,21,9,25,10,12,30,2,35,29,16,20,31,4],get_font:7,half:[9,3],now:[20,21,22,12,30,3,36],nor:[26,10,9],introduct:5,name:[6,7,0,8,23,9,21,30,2,13,29,3,27,36,31,4],pm_recommended_input_devic:21,drop:[30,20],separ:[6,7,9,30,36,25,27,3,26,20,18,31,21],magazin:5,jaggi:28,x10:21,x11:[12,21,14,0],x12:21,x13:21,style_obliqu:30,compil:[30,5,2,18],domain:3,collide_rect_ratio:9,replac:[20,22,11,30,3,26,36],individu:[5,30,2,27,29,36],gl_set_attribut:0,strikethrough:[],wrestl:3,contributor:31,redistribut:31,happen:[24,29],tri_left:18,baselin:[30,7],shown:[33,0],space:[21,8,23,11,32,7],profit:31,write_sys_ex:21,rotate_y_ip:1,formula:11,blend_rgb_sub:36,bla:32,correct:[33,13,7,14,31],broken_x:18,earlier:[12,22,34,3],dokil:9,state:[6,9,8,12,30,14,3,20,36,4],rle:36,map_arrai:[22,26],runtimeerror:2,bayer:31,theori:31,org:[24,1],"byte":[20,7,0,22,11,12,30,2,14,15,36,21],unpredict:30,care:20,leftclick:3,array_alpha:26,rotate_z_ip:1,question:8,thier:9,frequenc:20,synchron:21,yuv:[33,31],motion:[6,14],thing:[12,19,2,29,4],place:[21,9,35,0,1,11,12,2,13,14,26,27,17,36,4],arraytyp:[26,10,3],first:[20,7,9,8,30,19,28,25,11,32,22,26,13,34,3,16,29,17,36,21],origin:[28,9,30,19,0,11,32,13,3,36],directli:[7,22,36,10,11,32,26,27,15,16,18,4],onc:[6,7,0,30,29,21,24,25,11,32,2,27,34,20,36,31,4],arrai:[5,20,8,30,10,11,22,14,3,26,36],"0x7d":21,yourself:[7,9],fast:[19,3,11,28,26,36],get_lines:7,open:[5,21,24,12,29,31],size:[9,3,4,7,0,11,13,14,26,17,18,31,20,22,19,24,16,28,30,32,33,36],run_speed_test:3,given:[28,24,6,7,0,30,23,9,1,25,26,2,13,14,3,16,20,17,36,19,4],gif:32,silenc:27,abstractgroup:9,circl:[16,17,9,3],k_f12:8,k_f13:8,libsdl:[],k_f11:8,get_arraytyp:[26,10],k_f14:8,k_f15:8,hue:31,get_sprites_at:9,"0xrrggbbaa":23,k_ralt:8,set_num_channel:20,svgalib:0,specifi:[28,20,7,9,30,19,0,12,34,3,31,21],broadcast:11,enclos:9,get_at_map:36,wav:[12,20],than:[0,1,2,3,5,6,7,8,9,13,26,17,31,20,21,19,25,16,28,29,30,32,34,36],png:[32,3],wide:[16,30,7],aacircl:17,set_displai:24,midiexcept:21,were:[9,27,0],posit:[24,6,7,9,27,29,19,0,34,30,13,14,3,20,17,36],surrog:[30,15],seri:[16,21],pre:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],sai:36,ani:[0,2,3,4,5,6,7,9,11,12,13,26,17,18,31,20,21,22,24,25,16,28,29,30,32,33,34,36],deliv:21,nosubprocess:27,notimplementederror:34,bitwis:[8,19,0],sdl_windowid:0,callback:9,destroi:32,bezier:17,hotspot:14,note:[32,28,20,21,30,29,23,24,1,25,10,11,12,2,14,3,26,34,17,31],taka:31,clamp_ip:13,take:[28,24,6,21,9,8,15,1,11,32,30,27,34,3,16,20,18,4],advis:31,interior:28,environ:[12,24,4,21,0],noth:[9,29,4],channel:[32,23,20,21,34],surf:[30,17,9,36,3],begin:[5,20,24,10,13,34,28,26,31],sure:[12,9,6,25,4],f11:8,normal:[7,9,30,23,24,1,2,13,29,3,27,36,19],buffer:[32,20,21,0,22,12,36,31],k_question:8,statu:[21,3],toplevel:20,get_siz:[30,19,24,11,36,31],set_mod:[8,12,35,36,0],icon:0,later:[20,21,9,11,12,17,31,4],drive:29,runtim:[26,28,25,10,0],"0x90":21,axi:[6,0,1,11,26,4],show:[33,28,27,14,3],"24x24":18,cheap:9,subprocess:27,bright:31,permiss:0,threshold:[19,28,11],corner:[30,19,11,14,28,16,36],k_semicolon:8,rotat:[30,1,28],get_fram:24,onli:[9,4,6,7,0,10,11,12,13,26,17,18,31,20,21,19,24,27,28,29,30,32,34,35,36],slow:[36,0],ratio:[13,9],activ:[20,14,0,10,34,26,36],pump:[6,4],fgcolor:30,get_wm_info:0,parametr:1,dict:[27,4,13,36,0],offici:[26,10],testin:21,overwritten:36,variou:[35,5,4,18,3],get:[0,2,3,4,5,6,7,8,9,10,11,12,14,26,19,20,21,23,24,25,27,28,29,30,31,34,36],goodluck:3,unscal:30,cannot:[24,20,7,9,0,13,34,15,26,17,36,31],progress:22,sse:[28,3],kmod_non:8,requir:[32,28,20,7,9,0,10,12,13,3,26,36,4],newarrai:11,max_x:30,make_surfac:[22,26,11],blit_hw_cc:0,where:[5,28,20,34,9,23,0,1,11,12,33,27,14,3,29],vision:[5,31],cursorfil:18,k_comma:8,ball_numb:6,set_icon:0,get_sprites_from_lay:9,note_off:21,euclid:1,wonder:[26,10],detect:[9,30,19,11,2,3],sprite_list:9,errorstr:2,max_i:30,enough:[30,9,3],volatil:36,between:[0,1,4,6,7,8,9,10,11,12,13,26,20,21,22,19,24,25,16,27,30,34,36],"import":[5,20,7,24,10,2,27,3,26,35,17,4],indexoutofbound:9,across:19,video_mem:0,cdrom_tag:27,parent:36,screen:[5,24,7,9,8,0,32,13,14,3,35,36],style:[30,4,6,3],come:[21,30,19,7,3,4],mono:[20,10],region:[32,19,36,28],contract:[31,28],emit:14,multicolor:3,tutori:[5,3],mani:[24,20,7,9,8,19,0,25,30,2,13,14,28,16,29,36],pixels_alpha:26,improp:16,acceler:[0,24,33,28,16,17,36],jitter:6,get_act:0,color:[5,7,9,22,30,23,0,11,32,26,36,28,16,17,18,19],inspir:5,period:8,get_endev:[20,34],get_mask:36,libmp3lam:24,anti:[16,5,17,30],typic:[36,31],poll:[21,4],damag:31,caret:8,stretch:[30,24,7],invert:[30,19,11],invers:28,mark:[8,11],valueerror:[12,22,24,26,10],k_exclaim:8,correct_gamma:23,gl_accum_green_s:0,thousand:10,resolut:[0,30,24,25,33,28,36],get_id:[6,29],repres:[0,2,4,5,6,8,13,14,26,18,19,20,29,23,25,16,28,30,32,33,34,36],those:[5,6,7,9,22,11,12,30,14,28,20,18,31,4],sound:[5,20,24,10,34,3],angle_to:1,set_default_resolut:30,tostr:32,untransform:30,alter:[14,28],cast:[],invok:30,k_leftparen:8,margin:3,scrap_ppm:12,ctrl:8,mysurf:36,mousebuttondown:[14,4],"__tags__":27,henc:30,worri:[9,3],destin:[7,9,30,11,28,17,36,31],ptsize:30,eras:[19,9],ascii:[8,26,18,15],fastest:[36,0],freetyp:[30,5,7],develop:[27,1],author:31,same:[6,7,0,30,29,19,9,1,11,32,2,13,36,14,28,26,20,18,31,4],set_gamma:0,blend_rgba_add:36,binari:[5,18,31,33],html:23,pad:[30,28],stop_angl:16,time_m:9,eventu:[4,0],finish:[36,24,20,34],closest:0,nest:36,assist:36,driver:[24,21,0],antialias:[16,30,7,28],wordcap:4,driven:[9,0],capabl:0,bbox_pixel:[],improv:7,extern:[26,18,10],tradition:18,appropri:[4,0],get_rel:14,numfail:2,"0x10ffff":30,scrap_pbm:12,joystick:[5,4,6,3],dimension:[30,1,11],new_width:3,execut:27,tip:5,srcalpha:[22,36],rest:[29,4],bitmap:[30,32,18,14,28],kill:[27,9],aspect:13,speed:[30,2,25,3],joyhatmot:[6,4],struct:[22,26,36,30,11],hint:0,except:[32,20,7,0,30,21,28,12,2,13,14,15,36,4],littl:[9,2,25,3],desktop:0,palette_color:[19,28],rescal:3,pile:3,k_rctrl:8,real:[20,7,30,24,36,21],around:[6,0,1,25,11,13,14,3,16],onscreen:0,read:[21,9,30,12,3,36],sfnt:30,grid:30,ftfont:[30,7],mod:[34,4],renderplain:9,realtim:36,integ:[24,6,21,0,8,30,23,9,27,10,11,22,2,13,29,3,16,26,17,36,4],server:3,"0x20000000":36,num_track:29,use_arraytyp:[26,10],output:[21,3,19,24,28,31,7],manag:[5,6,9,30,24,29,20,36,4],k_plu:8,ascend:30,filled_trigon:17,ascent:[30,7],nonzero:[19,13],slice:[22,11],colorspac:31,micro:2,definit:12,k_slash:8,evolv:3,exit:[2,21,0],"0x00004000":36,set_gamma_ramp:0,refer:[5,0,10,12,26,36],power:[8,20,31],start_po:16,layeredupd:9,broken:[24,2,14],fulli:[8,26,36,9],bufferproxi:[36,20],comparison:[23,4,3],aaellips:17,mixer:[5,20,24,10,34,3],chop:28,sdl_gfx:17,degre:[26,19,1,28],stand:3,"32x32":0,skew:7,routin:[7,30,3,28,36,31,4],effici:[5,9,7,0],eval:27,get_metr:30,resampl:20,rotate_ip:1,latenc:[20,21],terminolog:14,icontitl:0,strip:36,your:[5,20,7,0,8,21,9,25,12,2,32,29,3,17,18,31,4],k_9:8,k_8:8,buffer_s:21,opengl:[3,36,0],k_1:8,k_0:8,k_3:8,k_2:8,distance_to:1,k_4:8,overwrit:[16,3],k_6:8,start:[6,34,9,30,29,19,24,11,2,14,3,20,17,36,31],collided_cal:9,interfac:[20,21,22,11,30,26,36],lot:[36,6,25,3],strictli:17,get_bal:6,tupl:[7,30,36,23,1,10,11,2,27,29,26,18,19],bundl:[30,7],overlap_area:19,satur:31,pyportmidi:21,k_y:8,pull:31,pixels_green:26,dirti:9,possibl:[32,20,7,9,30,0,12,36,31],"default":[0,1,2,3,4,7,9,10,12,14,15,26,31,20,21,22,23,24,19,27,30,32,36],k_p:8,k_r:8,k_u:8,k_t:8,k_w:8,k_v:8,k_i:8,k_h:8,k_k:8,k_j:8,k_m:8,k_l:8,k_o:8,k_n:8,k_a:8,embed:0,k_b:8,k_e:8,k_d:8,k_g:8,expect:[22,27,23,20],creat:[0,3,4,5,6,7,8,9,10,11,13,14,26,18,19,20,22,23,24,25,28,30,32,33,29,36],certain:[12,26,23,10,4],connected_compon:19,strongli:9,fila:3,decreas:20,file:[5,24,20,7,30,3,10,32,2,27,34,15,18],swsurfac:36,blendmod:9,intra:24,fill:[9,22,19,0,30,14,3,16,17,36,4],incorrect:22,again:[36,31,9],collid:[19,13,9],hex:23,mpeg1video:24,orient:[30,19],field:21,valid:[33,3,20,36,0],collis:[19,9,13,3],pathnam:20,you:[0,1,2,3,4,5,6,7,8,9,10,11,12,14,16,17,18,19,20,21,23,24,25,26,28,30,31,32,33,29,36],architectur:28,polar:1,event_nam:4,video0:31,colon:8,sequenc:[28,21,9,8,36,0,11,30,13,14,15,16,17,18,4],drift:6,pixelarrai:[5,11,36,3],multidimension:[],track:[5,25,29,9],retrac:0,reduc:[30,20],unionall_ip:13,directori:[30,27,7],joybuttonup:[6,4],descript:[8,30,2,35],bmp:[12,32],mimic:30,mass:19,potenti:32,set_volum:[24,20,34],escap:[8,30,15],cpu:25,unset:[19,36],colliderect:[13,9],represent:[26,5,23,10,11],all:[0,1,2,3,4,5,6,7,8,9,11,13,14,16,17,18,19,20,21,23,26,27,28,29,30,32,33,34,36],consider:36,dollar:8,unencod:[2,18],improperli:33,scalar:1,disc:29,mp3:[24,34],abil:[],follow:[32,6,9,8,19,1,12,30,34,3,26,20,18,31,4],alt:8,disk:32,pymedia:[],white:[18,14,11],gfxdraw:[5,17],init:[20,7,0,30,25,12,2,27,29,6,21],program:[5,33,20,21,0,8,29,24,25,30,2,13,34,3,27,4],neglig:31,introduc:22,array3d:26,mpg:24,liter:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],k_kp_enter:8,song:34,fals:[32,28,20,7,9,30,29,0,1,12,13,34,3,27,31,21],keydown:[8,35,4],vera:7,dokill2:9,mechan:[],fall:3,veri:[31,21,25,3],strang:0,unalt:2,bbmode:[],renderclear:9,list:[5,33,6,7,0,8,35,21,9,31,12,30,13,29,3,27,36,19,4],emul:[7,14,0],adjust:[30,23,3,7,0],stderr:27,pygam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],small:[30,2,6,31,14],dimens:[28,7,9,22,0,1,11,30,13,3,26,36,31],pase:7,update_rect:3,ten:25,testsprit:3,get_track_length:29,past:12,zero:[6,21,30,1,29,16,20],design:9,pass:[9,4,6,7,8,0,11,12,14,15,16,18,20,21,24,25,27,28,29,30,32,33,34,36],overlin:30,further:12,thickarrow_str:18,bilinear:28,run_tests__test:27,what:[5,6,7,9,23,0,3],nonlinear:36,xor:[18,14],sub:[9,3],clock:25,section:[16,36,35,29],abl:32,brief:[29,3],rgbx:32,delet:[8,36,11],version:[28,24,20,9,22,0,30,2,13,34,3,17],run:[20,0,28,25,32,27,3,4],rgba:[0,23,32,16,17,36],"0x00000100":36,method:[9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,20,29,22,19,24,25,26,30,32,34,36],contrast:[26,14,10],movement:[6,14,9],hasn:30,full:[24,6,7,9,30,0,11,32,14,3,20,36,4],pyopengl:[32,3],k_quotedbl:8,unmodifi:31,behaviour:12,horizontal_adv:[],ver:2,rudimentari:3,modifi:[9,8,10,30,13,35,17,36],valu:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36],search:[5,13,9],subview:11,prior:0,amount:[6,7,30,25,14,28],pick:[28,0],sdl_mixer:[20,34],via:30,frame_numb:24,primit:17,anytim:14,filenam:[20,7,30,24,32,34,18],capslock:8,href:[],pythagorean:1,famili:7,select:[20,21,0,8,12,27],ybool:28,mapped_int:36,stdout:27,regist:[12,2],two:[0,1,3,4,5,6,7,8,9,10,11,13,16,18,20,21,22,19,25,27,28,30,29],call:[0,1,2,3,4,6,7,8,9,14,16,17,18,31,20,21,24,25,27,29,30,32,33,34,36],qce:31,taken:[30,20,3],metric:[30,7],toggl:18,more:[5,6,7,0,8,30,21,9,25,31,32,22,2,29,3,20,36,19,4],diamond:18,desir:[36,31,28],kmod_lctrl:8,k_break:8,ital:7,flag:[7,9,22,0,30,35,3,36],aatrigon:17,particular:[9,10,11,27,34,31],cach:30,none:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,26,17,19,20,21,22,23,24,25,28,29,30,31,32,33,34,36],outlin:19,dev:31,remain:[26,36,13],hkey_local_machin:21,joyballmot:[6,4],learn:[36,3],blend_rgb_min:36,pushabl:6,def:9,scan:[6,29],share:[32,20,7,25,12,6,36,4],midis2ev:21,accept:[20,7,9,30,3,26,13,15,16,17,36],minimum:[32,19,36,7],surface_dest:9,forground:[],sharp:16,action:4,xxxx:18,newlin:7,k_tab:8,divid:8,rather:[17,28,7,25],anoth:[7,9,8,30,19,11,22,13,14,3,36],comfort:5,pixelcopi:[22,26,11,3],divis:18,simpl:[5,28,9,36,0,11,3,16,18,4],unabl:32,get_tim:[24,25],resourc:[20,2,18,3],referenc:26,joybuttondown:[6,4],reflect:1,plane:[33,24,36],overlap_mask:19,associ:30,"1bit":19,pointlist:16,k_greater:8,get_bottom_lay:9,endpo:16,loud:20,ambigu:20,caus:[7,30,31,19,11,12,34,28,23],k_home:8,zerodivisionerror:1,spheric:1,shade:16,get_sound:20,"_time_threshold":9,bitsiz:0,help:[5,20,7,9,8,21,25,30,27,14,3,36,4],soon:34,held:8,through:[20,21,9,30,19,2,4],k_euro:8,k_kp_equal:8,paramet:[16,30,1,25],fallback:7,k_lmeta:8,get_top_sprit:9,overhead:36,miter:16,kmod_rctrl:8,kmod_alt:8,harmless:0,pend:21,rapidli:8,exchang:11,might:[0,30,23,1,10,12,3,26],subscipt:11,lookout:3,good:[20,7,0,3,36,31],"return":[0,1,2,4,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,36],elips:17,timestamp:21,layer1:9,framework:3,compound:12,bigger:5,document:[35,5,20,31,36],get_default_resolut:30,hook:9,fastrendergroup:3,vcodec:24,instruct:28,easili:[2,18],k_leftbracket:8,radian:16,radial:1,found:[5,7,9,30,19,10,13,3,26,35,36,21],unicod:[20,7,8,12,30,2,15,36,4],difficult:21,truncat:20,clamp:[13,3],inplac:[],weight:11,idea:[36,0],group_list:9,realli:[33,28,4],pcx:32,connect:[16,19,3],fist:5,unional:13,k_kp_minu:8,event:[5,6,21,0,8,19,25,34,35,14,3,20,31,4],buffers:[20,21],set_po:[34,14],mousemot:[14,4],collide_mask:9,print:[8,12,2,7,4],dokill1:9,get_busi:[24,20,29,34],default_lay:9,foreground:30,mmx:[28,3],advanc:[5,7,9,30,24,36],get_top_lay:9,guess:20,someon:12,reason:[20,7,14,28],base:[7,9,30,3,31,4],ask:0,otherarrai:11,rect:[5,9,30,19,24,33,13,28,16,17,36],thrown:[28,4],sytem:4,thread:[20,7,9,24,27,3,17,31,4],othermask:19,veloc:21,omit:[30,27,21,11],caption:[36,0],perhap:36,lifetim:[26,11],mmsystem:21,someimag:3,major:2,blend_rgb_mult:36,upper:[36,6],feel:3,midtop:13,number:[0,1,2,3,6,7,8,9,10,11,26,19,20,21,23,24,25,16,27,28,29,30,32,34,36],placehold:2,gl_multisamplebuff:0,done:[30,23,7,34],least:[16,22,36],blank:7,stabl:22,render_fram:24,differ:[28,20,7,9,8,31,23,0,10,11,12,2,34,3,26,29,17,36,19],use_alpha:3,k_help:8,interact:[5,6,21,9,11,27,3,4],reentrant:27,rotate_x_ip:1,paint:[],illeg:13,store:[9,36,19,0,13,26,17,18],unicodeencodeerror:[30,2],eventid:25,assign:[27,11,13,9],option:[28,24,20,7,9,22,23,0,25,31,32,30,2,27,3,36,19,21],relationship:9,behind:[5,9],part:[30,19,27,28,17,36,4],k_escap:8,vide:24,render_raw_to:30,kind:[22,36,21],prebuilt:5,iyuv_overlai:33,whenev:2,remov:[7,9,10,28,26,4],"_tag":27,horizont:[30,17,28,31,3],list_camera:31,reus:31,str:[26,30,10],toward:0,comput:[5,20,7,30,25,32,29,3,6,31],k_numlock:8,start_angl:16,registri:21,packag:[5,7,10,32,2,27,3,26,4],expir:27,k_backquot:8,switch_lay:9,"null":[7,15],mousebuttonup:[14,4],lie:17,built:[30,32,2,15],equival:[22,30,21,11],check:[24,6,7,0,19,9,10,11,12,2,14,3,26,20,34,31,4],self:[36,19,1,9],also:[0,1,2,3,4,5,7,8,9,11,13,14,15,26,17,18,20,21,24,25,16,27,28,30,32,29,35,36],without:[20,9,30,13,26,6,36,31],build:30,techniqu:9,trail:27,alsa:21,k_asterisk:8,offscreen:24,distribut:[5,27,31],previou:[20,9,0,25,14,28],rrggbbaa:23,opentyp:30,most:[6,7,9,30,29,0,25,32,2,13,14,3,16,20,17,36],plai:[5,20,21,24,34,3,29],plan:36,alpha:[7,0,22,30,23,28,32,26,3,16,17,36,19],containt:14,spritecollideani:9,clear:[5,20,9,8,19,22,36,4],cover:[5,13,36,28],destruct:28,clean:14,azimuth:1,latest:30,blend:[16,30,36,3],layer_nr:9,k_lshift:8,doublebuf:[36,0],sdl_videodriv:[24,0],session:27,particularli:21,maniplu:[],font:[30,5,7,3],fine:[16,36,20],find:[5,20,7,9,30,19,28,29,3,36],penalti:36,indexerror:[36,21],copyright:31,k_print:8,solut:24,technic:33,"public":3,k_sysreq:8,experiment:[12,22,17,1,31],queu:[20,34],factor:[30,3],monospac:30,hit:3,unus:[32,20],palett:[7,0,32,28,26,36],"__file__":3,express:31,k_paus:8,nativ:[12,5,31],longest:20,liabl:31,get_queu:20,banner:[5,3],restart:[24,34],ffmpeg:[24,3],acur:25,bytes:[36,0],blend_rgba_mult:36,common:[8,24,9,28,0],doubler:28,set_endev:[20,34],forego:4,set:[0,1,2,4,7,8,9,10,11,12,14,16,18,19,20,21,22,23,24,25,26,28,30,31,32,33,34,36],dump:27,startup:20,mode_ok:0,mutabl:4,scancod:8,atexit:21,see:[24,20,21,9,8,30,19,0,32,22,14,3,26,29,36],arc:[16,17],arg:[9,27,3],make_sound:[20,10],reserv:20,analog:[6,11],fullscreen:[9,36,0],blend_mult:36,someth:[28,31,3],topmost:9,"case":[5,20,21,0,22,23,32,30,2,36],smallest:[36,0],filled_circl:17,style_bold:[],subscript:11,experi:4,altern:[3,13,0],signatur:13,set_at:[19,36],numer:[26,20,1,10,3],blend_rgb_add:36,complement:1,numev:[20,25,4],isol:36,lowercas:7,frombuff:32,unrot:30,outfil:24,solv:20,primarili:2,both:[20,7,0,8,11,32,30,14,28,16,29,17,36,21],last:[6,9,30,25,26,16],opac:30,alon:3,k_lctrl:8,k_down:8,get_error:[30,2],groupsingl:9,load:[5,20,7,9,30,24,32,34,3,18,31],map_rgb:[36,11],simpli:[21,9,0,33,18,4],point:[28,24,7,9,30,23,3,1,13,29,15,16,17,19,21],arbitrarili:0,tga:32,"0xf0":21,shutdown:0,linux:[21,34,31],averag:[30,28,27,7,25],throughout:35,backend:[22,0],identif:21,becom:[30,36,20,0],instrument:21,k_left:8,devic:[5,6,21,14,3,29,31,4],due:23,empti:[7,9,30,19,0,12,13,29,27,4],bgcolor:30,get_curr:29,move_to_back:9,imag:[5,28,7,9,30,36,19,0,12,33,32,14,3,26,18,31],consequenti:31,coordin:[6,30,19,1,13,14,28,17,36],understand:[5,21,33],rgba_premult:32,look:[21,28,26,2,3,16,18,7],solid:[7,9,26,28,16,36],straight:[16,17],getfilesystemencod:[2,15],"while":[6,7,9,22,25,10,11,12,29,20,36,4],abov:[0,22,10,11,33,15,26,31],error:[21,0,22,23,28,30,2,27,3],enable_swizzl:1,win32:21,loop:[24,20,25,34,4],pack:[26,36,0],earli:5,readi:[27,31],screen_rect:9,readm:5,jpg:32,pxarrai:11,itself:[7,22,11,30,2,36],hflip:31,set_tim:25,seem:[12,24],"24bit":[32,36,31],pcf:30,recommended_input_devic:21,minim:0,belong:9,has_video:24,as_spher:1,shorter:0,decod:[12,30,24],eventlist:[4,3],use_stat:3,higher:[26,5,4,0],sndarrai:[5,20,10,3],dga:0,get_hat:6,k_period:8,optim:[28,3,36,7,0],inflat:[30,13],moment:[12,10],temporari:28,user:[5,21,0,8,1,30,2,27,36,31,4],weird:8,euro:8,subpackag:27,lower:[20,21,0,19,33,29,26,6],testout:21,lib:3,older:[2,6],set_alpha:[22,36],entri:[8,36],scale_to_length:1,style_ital:[],expens:9,"0x10000000":36,explan:3,depermin:0,rewound:24,midbottom:13,xserver:14,shape:[16,5,17,22,11],set_length:23,regardless:[2,7],rundown:3,mustlock:36,cut:20,predomin:22,set_reserv:20,spritecollid:9,rgb:[7,0,22,23,32,33,16,17,36,31],"0x0000000a":36,theorem:1,input:[5,6,21,0,8,28,27,14,3,31,4],style_wid:30,approxim:19,onput:21,transpar:[7,0,22,19,28,32,26,3,16,36],big:[2,9],scrap_text:12,get_layer_of_sprit:9,game:[5,6,0,9,25,2,3,36,31,4],insert:8,bit:[5,28,6,7,0,8,30,19,9,15,10,11,22,3,26,20,17,36,31],infil:24,formal:30,an_id:21,movieplay:[24,3],success:2,mediaon:[],docutil:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],signal:34,trigon:17,resolv:12,collect:0,"boolean":[8,16,6,7,14],popular:3,sizeabl:0,unfilt:28,k_colon:8,often:[32,36,1,29,0],spring:28,visibl:[33,9,14,0],some:[0,1,2,4,5,6,7,9,11,12,13,14,16,17,18,31,20,21,28,30,32,34],back:[9,20,21,29,3],bach:34,unspecifi:30,sampl:[5,20,10,28],scale:[9,30,19,3,1,32,28,31],screen_dim:3,"0x01000000":36,per:[5,30,19,24,25,10,32,27,26,17,36,4],substitut:31,mathemat:36,larg:[22,5,13,36,30],slash:8,was_init:30,reproduc:31,either:[28,6,29,9,30,36,23,0,32,13,14,15,20,18,31],machin:[28,3],intial:20,colliding_sprit:9,get_desc:7,pixels3d:26,k_kp4:8,step:[5,17,11,4],subtract:[],impos:[8,20],shrinkag:28,get_underlin:7,bgd:9,unicodeerror:7,idx:9,blend_max:36,transpos:11,materi:31,glcube:3,average_color:28,retransform:28,"0xdfff":30,idl:[20,34,4],preset:20,videoinfo:0,needn:3,"32bit":32,collide_rect:9,gamma:[23,0],get_abs_par:36,sdl_delai:25,k_rightparen:8,tiff:12,within:[30,19,28,36,9],k_underscor:8,ensur:[8,20,4],framer:[5,25,31],k_kp_multipli:8,occupi:[],inclus:30,span:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],xpm:32,errno:21,megabyt:0,"long":[30,27,34,4],custom:[5,20,9,0,14,3,36],arithmet:[23,11],includ:[5,28,6,7,9,30,35,0,25,32,13,36,3,27,17,18,31,21],suit:[36,27],forward:[8,24],anyformat:36,scrap_clipboard:[12,3],"0x00000002":36,properli:[5,27,14],kmod_lalt:8,repeatedli:[28,36,25,9],translat:[8,30,11,15,3],newer:34,scope:11,sdl:[28,0,22,24,33,2,3],line:[5,7,32,27,3,16,17],outputimag:3,info:[21,0],get_grab:4,collide_circl:9,utf:[12,30,15],"0xc0":21,consist:[12,20,29,4],caller:21,unlock:[16,36],readlin:18,similar:[6,9,30,24,25,10,11,32,36],change_lay:9,curv:17,tick_busy_loop:25,enlarg:30,constant:[5,8,25,30,2,35],k_less:8,smoothli:28,doesn:[30,36,7,3],get_empti:29,"char":[30,36,7],incomplet:27,scrap_:12,rleaccel:36,kmod_ralt:8,home:8,chromin:31,polygon:[16,17],titl:0,sequenti:16,invalid:[20,28,24,13,0],windib:[24,0],codec:2,x7d:21,style_underlin:30,draw:[5,24,7,9,30,19,0,32,16,17,36],elementw:1,hwpalett:36,"0xaacce":11,amplitud:10,k_kp7:8,get_block:4,algorithm:[19,28],style_strong:30,dvd:29,sdlerror:34,xbm:18,depth:[0,11,28,26,36,31],dot:[30,1],far:[12,1,3],scroll:[36,3],moveit:3,code:[5,6,7,9,8,30,15,11,12,22,3,17,36,31,4],partial:[16,36,21,0],edg:[7,13,14,28,16,17,36],centeri:13,queri:[12,0],image_fil:3,alien:3,kmod_lmeta:8,ellips:[16,5,17],ellipt:16,centerx:13,k_backspac:8,"0x00000004":36,hsva:23,privat:36,procur:31,send:[20,21,34,4],rudder:6,aris:31,sent:[8,20,6,34,0],quadruplet:[16,17],wave:10,mous:[5,6,12,14,3,18,4],volum:[5,24,20,34],implicitli:36,tri:12,set_bold:7,succeed:31,fadeout:[20,34],button:[8,4,6,14,3],inclin:1,get_driv:0,"try":[30,24,36,7],convolv:19,dealt:4,hwsurfac:[36,35,0],has_audio:24,hwaccel:36,pleas:[1,4],impli:[30,31],smaller:[36,20,13,31,0],fortun:3,pixels2d:26,cff:30,natur:[24,34],get_abs_offset:36,crop:[13,28],uniqu:[36,6,9],jump:14,video:[5,6,0,24,33,3,36,4],click:[14,3],compat:[20,7,9,22,0,10,32,30,26,4],index:[5,9,8,30,0,11,22,13,29,26,36],bdf:30,compar:[11,2,9],resembl:[22,26,3],multimedia:8,access:[5,33,6,7,9,22,21,10,11,12,30,29,3,26,20,36,4],importerror:[26,10],clipboard:[12,5,3],get_count:[6,21,29],whatev:9,keyascii:8,construct:13,backslashreplac:2,len:[23,9],pixels_r:26,openglblit:36,let:[30,23,2,3],get_sized_descend:30,vertic:[0,30,28,11,32,3,16,17,31],sinc:[20,29,0,25,32,14,26,6,36,4],redrawn:[33,0],get_sized_height:30,convers:[26,23,24,31,11],typelist:4,min_alpha:36,larger:[36,20,28],headless:3,xormask:14,chang:[0,1,3,5,6,7,9,10,11,12,13,26,17,31,20,21,22,16,28,30,34,36],get_sized_glyph_height:30,chanc:20,k_pageup:8,"0xffff":0,scaler:3,nearest:20,newbi:5,appli:[21,23,3,1,28,36],app:3,aquir:26,inequ:4,use_fastrendergroup:3,api:[12,17,1,21,31],surface_to_arrai:22,fed:31,from:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,26,17,18,19,20,21,22,23,24,27,28,29,30,31,32,34,35,36],usb:21,commun:4,doubl:[36,28],next:[20,30,1,12,33,17,31],few:[30,2,18,7,25],camera:[5,31,3],unmap_rgb:36,usr:[7,3],sort:[4,9,3,0],get_nam:[6,29],rotate_z:1,subprocess_ignor:27,pfr:30,get_offset:36,rare:[2,36],iii:24,as_polar:1,pre_init:20,account:[20,8,11,30,34,6],retriev:[20,4],scalabl:30,alia:12,write_short:21,annoi:5,default_id:21,length_squar:1,endian:2,meet:13,get_cursor:14,set_repeat:8,aliv:9,control:[5,24,6,7,0,8,29,9,25,33,27,36,34,3,26,20,18,31,4],mpeg1:[],malform:30,process:[25,12,27,3,26,31,4],lock:[9,22,11,26,16,36,4],collidepoint:13,filled_polygon:17,high:[9,3],tag:27,tab:8,subsystem:4,"0x13":21,get_vers:30,delai:[8,21,25,3],surfac:[5,28,24,7,9,22,30,19,0,1,11,12,26,33,32,3,16,17,36,31],get_colorkei:36,filepath:3,six:[20,34],need:[5,6,7,0,8,36,9,11,12,2,27,32,29,3,17,18,4],subdirectori:3,instead:[28,24,7,9,30,0,15,10,11,26,2,27,34,3,16,36],circular:[16,17],milisecond:21,cache_s:30,overridden:[30,20],num_ev:21,watch:5,k_power:8,physic:6,device_id:[21,3],blit_sw_cc:0,alloc:32,pixels_blu:26,bind:21,correspond:[30,19,27,11],get_surfac:0,issu:[26,10],multi_thread:27,wordwrap:7,allot:27,allow:[5,6,7,9,30,31,23,0,11,12,32,28,20,18,19,36,4],get_tick:25,blit_hw_a:0,vidinfo:0,blit_sw:0,get_press:[8,14],set_grab:[8,14,4],ouput:21,movi:[5,24,3],distance_squared_to:1,move:[5,28,9,24,13,14,3,36],whilst:[],own:[20,21,12,3,18,4],comma:[8,7,21],treshold:9,filelik:18,darken:0,directx:[24,21,0],perfect:19,accur:[25,14],outer:16,chosen:[30,31,0],get_palett:36,arraydemo:[5,3],total:[20,22,24,2,27,34],set_capt:0,pixel:[5,31,7,0,22,30,23,28,11,32,26,33,13,36,3,16,17,18,19],gl_stencil_s:0,lastli:[14,9],crash:[33,34],greater:[20,7,8,19,36,21],python:[5,24,20,7,9,22,36,15,32,30,2,13,3,27,18],blend_xxx:3,mod_:35,set_loc:33,cdrom_test:27,set_instru:21,front:[5,9],get_par:36,quotedbl:8,diagon:28,anyth:[7,9,0,2,29,36],mode:[20,7,9,8,0,12,30,27,14,3,16,17,36,4],subset:18,themselv:36,inflate_ip:13,remap:11,consum:25,meta:8,greyscal:28,thirteen:5,playabl:10,patch:[2,3],special:[20,9,22,36,0,28,18,31],out:[20,21,30,19,34,31],variabl:[21,0,24,2,18,7],pmdeviceid:21,kmod_mod:8,contigu:16,source_rect:9,collidedictal:13,ffff:15,set_underlin:7,suitabl:[12,7],rel:[6,21,9,33,14,4],hardwar:[21,0,36,24,33,16,17,18],ref:[],get_palette_at:36,red:[9,23,0,11,26,36,31],fun:3,shut:[30,2,0],insid:[9,30,36,19,32,2,13,3,16,17,18],parenthesi:8,manipul:[5,20,10,11,32,13,26,36],uyvy_overlai:33,get_default_font:[30,7],argb_premult:32,gl_depth_siz:0,dictionari:[9,27,4,13,0],releas:[6,21,8,11,12,30,2,14,17,36,31],k_lalt:8,shortest:1,indent:11,midi:[21,3],guarante:[12,27,20,4],could:[21,9,8,28,10,12,33,3,26,4],area:[28,24,6,7,9,30,19,0,13,3,16,17,36],put:12,membership:9,timer:[21,25],keep:[6,9,25,10,26,28,16,17,4],stride:11,length:[20,23,24,1,11,29,36],outsid:[17,36,7,14],retain:[36,31],time_out:27,ndim:11,softwar:[5,21,9,0,33,16,17,36,31],suffix:13,k_5:8,pgm:[32,3],qualiti:3,echo:3,asyncblit:36,k_7:8,show_output:27,strict:31,unknown:[6,7,0],licens:5,system:[5,24,6,7,0,8,29,21,15,10,12,30,2,27,36,14,3,26,34,18,4],messag:[2,27,21,4],attach:[4,25,3],blit_hw:0,scant:3,termin:[2,21],"final":[7,30,11,35,3,16,36],shell:3,repaint_rect:9,get_numtrack:29,botom:0,ogg:[20,34],exactli:[36,13,21,11],spriteright:9,photograph:28,unmap:22,freetype2:30,initalis:2,structur:22,charact:[7,0,8,30,22,2,15,26],claim:31,k_lsuper:8,f12:8,f13:8,f10:8,rate:20,f14:8,f15:8,iconifi:0,clip:[16,36,9,13,3],get_numhat:6,respons:27,deprec:[26,10],gl_get_attribut:0,interf:21,blit:[28,24,7,9,22,0,30,3,26,17,36],have:[0,1,2,3,4,6,7,8,9,11,12,13,16,18,31,20,22,23,24,25,26,27,28,30,34,36],tabl:[22,0],close:[21,0,30,12,34,3,16,31],turn:[30,19,21,28],border:[3,13,14,0],min:19,get_paus:29,expos:[22,30,36,4],startpo:[16,34],get_height:[36,7],mix:[36,20,7],builtin:[30,7],which:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,26,31,20,21,19,24,25,27,28,30,32,36],k_kp_period:8,singl:[33,20,7,9,8,36,23,0,11,22,13,34,26,27,17,18,4],scale2x:28,textur:17,unless:[30,36,28],freebsd:3,doublebuff:0,who:5,blit_sw_a:0,eight:3,monochrom:30,segment:16,"class":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],stereo:[20,10],latin1:[30,7],eject:29,yuv2_overlai:33,hardcod:3,brought:28,face:5,pipe:0,get_loss:36,determin:[21,9,8,1,32,33,34,28,29,36,7],constrain:[16,14],fact:[16,17],smpeg:[],k_capslock:8,text:[21,8,12,30,3,7],syntaxerror:2,k_caret:8,bring:9,"static":9,utf8_str:12,longer:[20,6,29],compound_text:12,locat:[33,19,14,3],nois:[19,6],surfa:5,k_quot:8,brighten:0,kmod_meta:8,should:[28,6,7,0,30,21,9,1,25,11,32,2,29,3,20,36,19,4],won:9,suppos:[30,28],local:[35,5,2,20],array_colorkei:[22,26],meant:2,cube:3,get_volum:[20,34],k_x:8,convert:[21,30,36,24,10,32,34,26,18,31,4],bear:[30,7],regularli:6,joint:16,k_z:8,increas:[30,9,20,0],triangl:[17,3],enabl:[7,8,24,1,30,4],organ:[5,9],button3:14,k_q:8,button1:14,stuff:12,integr:31,contain:[0,2,4,5,6,7,8,9,12,13,14,16,18,20,21,22,19,24,27,30,32,29,35,36],grab:[8,14,4],view:[36,11],get_fp:25,writeabl:36,frame:[9,24,25,36,31,4],displai:[5,24,20,9,8,0,12,33,27,14,3,16,35,17,36,4],collidelistal:13,temporarili:[20,29,8,24,26,34,16,36],maxtim:20,get_bounding_rect:[19,36],xxxxx:18,athlon:3,nofram:[36,0],correctli:[20,21,28],pattern:[30,34],boundari:30,k_scrollock:8,xbool:28,written:[16,5],quickest:36,crude:3,theta:[19,1],neither:[26,10,9],thumbnail:3,kei:[5,0,8,19,13,3,35,36,4],k_right:8,entir:[5,20,9,0,29,16,36],measur:[21,34],otherwis:[32,28,20,21,9,22,19,0,1,10,12,30,14,3,26,36,31],joi:4,k_c:8,addit:[6,21,0,8,9,1,12,2,3,16,36],exclaim:8,ramp:0,incident:31,get_pitch:36,etc:[32,6,21,11],instanc:[6,9,30,11,13,29,20,17,36],k_f:8,comment:3,"__dict__":4,bbox_pixel_gridfit:[],math:1,arguement:[],respect:[12,16,1,36,9],disable_advanced_featur:2,quit:[6,7,0,30,21,24,2,27,29,3,20,36,4],tort:31,addition:[26,10],get_bold:7,compon:[22,36,23,1,19],get_po:[34,14],besid:29,treat:[20,0,30,10,26,6],axis_numb:6,immedi:[4,20,21,0],set_mask:36,k_f5:8,togeth:[8,28],yvyu_overlai:33,ggi:0,present:[2,21],therefor:9,plain:12,align:[30,13],rectangular:[9,11,13,16,17,36],cursor:[5,18,14,3],defin:[12,9,35,7,4],milliscond:25,layer:[24,9],almost:5,demo:3,site:3,archiv:[30,7],lightweight:9,incom:5,uniti:6,min_x:30,mute:20,satisfi:0,cross:1,sqrt:1,member:[9,4],handl:[5,28,6,7,0,8,30,9,22,2,15,20,4],speaker:20,min_i:30,largest:19,inch:30,directfb:0,phi:1,ball:[6,4],http:24,context:36,denot:13,expans:28,move_ip:13,oldalien:3,effect:[5,28,7,0,9,2,13,3,36,4],handi:3,effeci:4,sysrq:8,blit_blend:3,get_mod:8,expand:28,k_ampersand:8,outputmask:19,exceedingli:30,off:[20,21,30,28,3,16,6,31,4],center:[6,9,19,13,3,16,17,36],bbox_exact:[],array_to_surfac:22,well:[32,30,11,12,2,28,16,17,36],"0x12":21,"0x11":21,"0x10":21,sett:36,exampl:[5,28,20,7,9,22,36,19,24,10,12,2,27,32,34,3,17,18,21],command:[27,3],textmarker_str:18,kmod_shift:8,choos:[3,21,0],undefin:30,audio:[5,20,21,24,10,12,34,3,29],get_sprit:9,usual:[6,7,9,30,0,2,20,36,4],distanc:[1,11],paus:[20,34,8,24,25,29],less:[20,7,8,25,28,21],k_rmeta:8,obtain:[30,21],bbox_exact_gridfit:[],vgrade:3,heavili:4,kmod_rshift:8,simultan:20,web:3,aalib:0,rapid:6,amd64:28,button2:14,"0xf7":21,data1:21,rotozoom:28,aalin:16,add:[9,0],get_sdl_vers:2,shinner:[],bool:[32,24,6,7,0,8,29,21,9,1,34,12,30,13,14,20,36,31,4],logger:3,match:[20,21,0,22,11,30,28,26,36,7],futur:[22,30,20,21,36],fixed_width:30,inputimag:3,dest:[30,36],piec:30,punctuat:7,five:[20,34],know:[8,32,7],magnifi:3,press:[8,6,14,3],sonix:31,tick:25,python2:3,loss:[31,0],like:[5,28,35,6,0,8,30,23,9,11,32,22,2,31,36,3,20,17,18,19],lost:[12,34],pyam:[5,11],pygame_freetyp:7,outpng:3,blend_rgba_max:36,necessari:[30,36,20,4],lose:[8,28,29,0],tri_right:18,resiz:[5,0,19,28,13,3,36],imagefil:3,page:[8,5,14],instrument_id:21,captur:[32,5,31,3],disable_swizzl:1,suppli:[19,21,31],"export":[22,20,11],flush:21,proper:[8,30,20],enviro:7,librari:[21,30,2,3,17,31],glyph:[30,7],fade_m:20,avoid:[27,20,1,29,11],overlap:[19,13,9],outgo:21,esc:3,overlai:[5,33,24,3],throttl:6,kmod_num:8,k_f10:8,usag:[36,27],although:4,offset:[21,30,19,11,13,34,3,36,7],simpler:3,rotate_x:1,about:[5,6,21,0,9,1,10,11,2,14,3,26,29,36],redraw:33,actual:[20,21,0,30,25,33,34,28,16,29,36,31,7],column:11,rotate_i:1,constructor:[30,13,6,9],change_return:28,disabl:[8,24,1,25,30,36,4],gl_accum_alpha_s:0,end_po:16,ucs4:30,convolut:19,automat:[32,24,6,7,9,30,0,12,2,35,29,20,17,36,21],warranti:31,pm_recommended_output_devic:21,scrollock:8,laplacian:28,awhil:29,list_mod:0,mere:21,headless_no_windows_need:3,get_al:29,processor:[25,28],pictur:32,kern:[30,7],transfer:[32,5],array2d:26,font_index:30,layeredrendergroup:[],biggest:0,get_at:[19,36],blend_rgba_sub:36,"function":[0,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,31,20,21,22,25,26,27,28,29,30,32,34,36],get_repeat:8,continu:[2,20,9],gain:[30,4,0],overflow:4,bug:[23,1,28],from_threshold:19,count:[20,19,11,29,28,6],succe:0,made:[5,10,0],wise:30,whether:[20,30,3,12,13,14,28,31],shrunk:36,smooth:7,flip:[0,19,11,32,13,28,31],asynchron:36,record:[26,30,27,31],below:[31,9,21,3],limit:[20,7,0,25,32,27,34,26,29,36,31],indefinit:[20,34],blend_rgb_max:36,render_raw:30,problem:[22,2],acodec:24,srap_select:12,cursor_arg:18,"catch":2,sizer_y_str:18,"int":[6,7,33,8,31,23,11,30,2,36,19],mask:[9,30,36,19,0,11,14,3,18],dure:[17,31,11],pie:17,k_delet:8,k_rightbracket:8,implement:[21,9,22,23,11,3],"8bit":[26,32,36,7,0],probabl:[19,3],nonetheless:3,simular:[],k_insert:8,seul:1,detail:[5,9,33,35,28,36],virtual:[13,21,14,3],other:[0,1,2,3,4,6,7,9,10,11,12,13,26,31,20,22,23,25,19,27,28,30,32,29,36],lookup:[9,4,7,0],new_height:3,rememb:[9,36,14,4],varieti:4,dropout:20,repeat:[20,0,8,24,2,34],star:3,prealloc:36,kmod_cap:8,time_proc:21,k_end:8,vflip:31,get_lock:36,debian:[34,3],quicker:[28,36,9],mozart:34,reliabl:21,kanji:30,portion:[36,28,13,0],timer_resolut:[35,25],asurf:32,hsv:[23,31]},objtypes:{"0":"py:module","1":"py:method","2":"py:class","3":"py:attribute","4":"py:function","5":"py:data","6":"py:exception"},titles:["<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.display</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.math</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.examples</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.event</span></tt>","Pygame Front Page","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.joystick</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.font</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.key</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.sprite</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.sndarray</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.PixelArray</span></tt>","<tt class=\"docutils literal\"><span class=\"pre\">pygame.scrap</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.Rect</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.mouse</span></tt>","File Path Function Arguments","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.draw</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.gfxdraw</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.cursors</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.mask</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.mixer</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.midi</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.pixelcopy</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.Color</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.movie</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.time</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.surfarray</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.tests</span></tt>","<tt class=\"docutils literal docutils literal docutils literal\"><span class=\"pre\">pygame.transform</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.cdrom</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.freetype</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.camera</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.image</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.Overlay</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.mixer.music</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.locals</span></tt>","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pygame.Surface</span></tt>"],objnames:{"0":"Python module","1":"Python method","2":"Python class","3":"Python attribute","4":"Python function","5":"Python data","6":"Python exception"},filenames:["ref/display","ref/math","ref/pygame","ref/examples","ref/event","index","ref/joystick","ref/font","ref/key","ref/sprite","ref/sndarray","ref/pixelarray","ref/scrap","ref/rect","ref/mouse","filepaths","ref/draw","ref/gfxdraw","ref/cursors","ref/mask","ref/mixer","ref/midi","ref/pixelcopy","ref/color","ref/movie","ref/time","ref/surfarray","ref/tests","ref/transform","ref/cdrom","ref/freetype","ref/camera","ref/image","ref/overlay","ref/music","ref/locals","ref/surface"]}) \ No newline at end of file
--- a/docs/tut/SpriteIntro.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ -<html><head><!-- -TUTORIAL:Sprite Module Introduction ---> - <title>Pygame Tutorials - Sprite Module Intoduction</title> -</head> -<body> - -<h1 align="center"><font size="-1">Pygame Tutorials</font><br> - Sprite Module Introduction</h1> - -<h2 align="center">by Pete Shinners<br> - <font size="-1">pete@shinners.org</font></h2> - -<h3 align="center">Revision 1.1, April 12th, 2002</h3> - <br> - <br> - Pygame version 1.3 comes with a new module, pygame.sprite. This module -is written in python and includes some higher level classes to manage your -game objects. By using this module to its full potential, you can easily -manage and draw your game objects. The sprite classes are very optimized, -so it's likely your game will run faster with the sprite module than without.<br> - <br> - The sprite module is also meant to be very generic. It turns out you can -use it with nearly any type of gameplay. All this flexibility comes with a -slight penalty, it needs a little understanding to properly use it. The <a href="../ref/sprite.html"> -reference documentation</a> for the sprite module can keep you running, but -you'll probably need a bit more explanation of how to use pygame.sprite in -your own game.<br> - <br> - Several of the pygame examples (like "chimp" and "aliens") have been updated -to use the sprite module. You may want to look into those first to see what -this sprite module is all about. The chimp module even has it's own line-by-line -tutorial, which may help get more an understanding of programming with python -and pygame.<br> - <br> - Note that this introduction will assume you have a bit of experience programming -with python, and are somewhat framiliar with the different parts of creating -a simple game. In this tutorial the word "reference" is occasianally used. -This represents a python variable. Variables in python are references, so -you can have several variables all pointing to the same object.<br> - <br> - -<h2>History Lesson</h2> - The term "sprite" is a holdover from older computer and game machines. -These older boxes were unable to draw and erase normal graphics fast enough -for them to work as games. These machines had special hardware to handle -game like objects that needed to animate very quickly. These objects were -called 'sprites' and had special limitations, but could be drawn and updated -very fast. They usually existed in special overlay buffers in the video. -These days computers have become generally fast enough to handle sprite like -objects without dedicated hardware. The term sprite is still used to represent -just about anything in a 2D game that is animated.<br> - <br> - <br> - -<h2>The Classes</h2> - The sprite module comes with two main classes. The first is Sprite, which -should be used as a base class for all your game objects. This class doesn't -really do anything on its own, it just includes several functions to help -manage the game object. The other type of class is Group. The Group class -is a container for different Sprite objects. There are actually several different -types of group classes. Some of the Groups can draw all the elements they -contain, for example.<br> - <br> - This is all there really is to it. We'll start with a description of what -each type of class does, and then discuss the proper ways to use these two -classes.<br> - <br> - -<h2>The Sprite Class</h2> - As mentioned before, the Sprite class is designed to be a base class for -all your game objects. You cannot really use it on its own, as it only has -several methods to help it work with the different Group classes. The sprite -keeps track of which groups it belongs to. The class constructor (__init__ -method) takes an argument of a Group (or list of Groups) the Sprite instance -should belong to. You can also change the Group membership for the Sprite -with the add() and remove() methods. There is also a groups() method, which -returns a list of the current groups containing the sprite.<br> - <br> - When using the your Sprite classes it's best to think of them as "valid" -or "alive" when they are belonging to one or more Groups. When you remove -the instance from all groups pygame will clean up the object. (Unless you -have your own references to the instance somewhere else.) The kill() method -removes the sprite from all groups it belongs to. This will cleanly delete -the sprite object. If you've put some little games together, you'll know sometimes -cleanly deleting a game object can be tricky. The sprite also comes with -an alive() method, which returns true if it is still a member of any groups.<br> - <br> - <br> - -<h2>The Group Class</h2> - The Group class is just a simple container. Similar to the sprite, it has -an add() and remove() method which can change which sprites belong to the -group. You also can pass a sprite or list of sprites to the contructor (__init__ -method) to create a Group instance that contains some initial sprites.<br> - <br> - The Group has a few other methods like empty() to remove all sprites from -the group and copy() which will return a copy of the group with all the same -members. Also the has() method will quickly check if the Group contains a -sprite or list of sprites.<br> - <br> - The other function you will use frequently is the sprites() method. This -returns an object that can be looped on to access every sprite the group contains. -Currently this is just a list of the sprites, but in later version of python -this will likely use iterators for better performance.<br> - <br> - As a shortcut, the Group also has an update() method, which will call an -update() method on every sprite in the group. Passing the same arguments to -each one. Usually in a game you need some function that updates the state -of a game object. It's very easy to call your own methods using the Group.sprites() -method, but this is a shortcut that's used enough to be included. Also note -that the base Sprite class has a "dummy" update() method that takes any sort -of arguments and does nothing.<br> - <br> - Lastly, the Group has a couple other methods that allow you to use it with -the builtlin len() method, getting the number of sprites it contains. and -the "truth" operator, which allows you to do "if mygroup:" to check if the -group has any sprites.<br> - <br> - -<h2>Mixing Them Together</h2> - At this point the two classes seem pretty basic. Not doing a lot more than -you can do with a simple list and your own class of game objects. But there -are some big advantages to using the Sprite and Group together. A sprite can -belong to as many groups as you want. Remember as soon as it belongs to no -groups, it will usually be cleared up (unless you have other "non-group" references -to that object)<br> - <br> - The first big thing is a fast simple way to categorize sprites. For example, -say we had a pacman-like game. We could make separate groups for the different -types of objects in the game. Ghosts, Pac, and Pellets. When pac eats a power -pellet, we can change the state for all ghost objects by effecting everything -in the Ghost group. This is quicker and simpler than looping through a list -of all the game objects and checking which ones are ghosts.<br> - <br> - Adding and removing groups and sprites from each other is a very fast operation, -quicker than using lists to store everything. Therefore you can very -efficiently change group memberships. Groups can be used to work -like simple attributes for each game object. Instead of tracking some attribute -like "close_to_player" for a bunch of enemy objects, you could add them to -a separate group. Then when you need to access all the enemies that are near -the player, you already have a list of them, instead of going through a list -of all the enemies, checking for the "close_to_player" flag. Later on your -game could add multiple players, and instead of adding more "close_to_player2", -"close_to_player3" attributes, you can easily add them to different groups -for each player.<br> - <br> - Another important benefit of using the Sprites and Groups, the groups cleanly -handle the deleting (or killing) of game objects. In a game where many objects -are referencing other objects, sometimes deleting an object can be the hardest -part, since it can't go away until it is not referenced by anyone. Say we -have an object that is "chasing" another object. The chaser can keep a simple -Group that references the object (or objects) it is chasing. If the object -being chased happens to be destroyed, we don't need to worry about notifying -the chaser to stop chasing. The chaser can see for itself that its group is -now empty, and perhaps find a new target.<br> - <br> - Again, the thing to remember is that adding and removing sprites from groups -is a very cheap/fast operation. You may be best off by adding many groups -to contain and organize your game objects. Some could even be empty for large -portions of the game, there isn't any penalties for managing your game like -this.<br> - <br> - -<h2>The Many Group Types</h2> - The above examples and reasons to use Sprites and Groups are only a tip -of the iceberg. Another advantage is that the sprite module comes with -several different types of Groups. These groups all work just like a regular -old Group, but they also have added functionality (or slightly different functionality). -Here's a list of the Group classes included with the sprite module.<br> - -<blockquote><b>Group</b><br> - This is the standard "no frills" group mainly explained above. Most of the -other Groups are derived from this one, but not all.<br> - <br> - <b>GroupSingle<br> - </b>This works exactly like the regular Group class, but it only contains -the most recently added sprite. Therefore when you add a sprite to this group, -it "forgets" about any previous sprites it had. Therefore it always contains -only one or zero sprites.<br> - <br> - <b>RenderPlain<br> - </b>This is a standard group derived from Group. It has a draw() method -that draws all the sprites it contains to the screen (or any Surface). For -this to work, it requires all sprites it contains to have a "image" and "rect" -attributes. It uses these to know what to blit, and where to blit it. <br> - <br> - <b>RenderClear<br> - </b>This is derived from the RenderPlain group, and adds a method named -clear(). This will erase the previous position of all drawn sprites. It uses -a background image to fill in the areas where the sprite were. It is smart -enough to handle deleted sprites and properly clear them from the screen when -the clear() method is called.<br> - <br> - <b>RenderUpdates</b><br> - This is the cadillac of rendering Groups. It is inherited from RenderClear, -but changes the draw() method to also return a list of pygame Rects, which represent -all the areas onscreen that have been changed.<br> - <br> - </blockquote> - That is the list of different groups available We'll discuss more about -these rendering groups in the next section. There's nothing stopping you -from creating your own Group classes as well. They are just python code, -so you can inherit from one of these and add/change whatever you want. In -the future I hope we can add a couple more Groups to this list. A GroupMulti -which is like the GroupSingle, but can hold up to a given number of sprites -(in some sort of circular buffer?). Also a super-render group that can clear -the position of the old sprites without needing a background image to do -it (by grabbing a copy of the screen before blitting). Who knows really, -but in the future we can add more useful classes to this list.<br> - <br> - - <h2>The Rendering Groups</h2> - From above we can see there are three different rendering groups. We could -probably just get away with the RenderUpdates one, but it adds overhead not -really needed for something like a scrolling game. So we have a couple tools -here, pick the right one for the right job.<br> - <br> - For a scrolling type game, where the background completely changes every -frame. We obviously don't need to worry about python's update rectangles in -the call to display.update(). You should definitely go with the RenderPlain -group here to manage your rendering.<br> - <br> - For games where the background is more stationary, you definitely don't -want pygame updating the entire screen (since it doesn't need to). This type -of game usually involves erasing the old position of each object, then drawing -it in a new place for each frame. This way we are only changing what is necessary. -Most of the time you will just want to use the RenderUpdates class here. Since -you will also want to pass this list of changes to the display.update() function.<br> - <br> - The RenderUpdates class also does a good job an minimizing -overlapping areas in the list of updated rectangles. If the previous position -and current position of an object overlap, it will merge them into a single -rectangle. Combine this with the fact that is properly handles deleted objects -and this is one powerful Group class. If you've written a game that manages -the changed rectangles for the objects in a game, you know this the cause -for a lot of messy code in your game. Especially once you start to throw in -objects that can be deleted at anytime. All this work is reduced down to -a clear() and draw() method with this monster class. Plus with the overlap -checking, it is likely faster than if you did it yourself.<br> - <br> - Also note that there's nothing stopping you from mixing and matching these -render groups in your game. You should definitely use multiple rendering groups -when you want to do layering with your sprites. Also if the screen is split into -multiple sections, perhaps each section of the screen should use an appropriate -render group?<br> - <br> - - - <h2>Collision Detection</h2> - The sprite module also comes with two very generic collision detection functions. -For more complex games, these really won't work for you, but you can easily -grab the sourcecode for them, and modify them as needed.<br> - Here's a summary of what they are, and what they do.<br> - - <blockquote><b>spritecollide(sprite, group, dokill) -> list<br> - </b>This checks for collisions between a single sprite and the sprites -in a group. It requires a "rect" attribute for all the sprites used. It returns -a list of all the sprites that overlap with the first sprite. The "dokill" -argument is a boolean argument. If it is true, the function will call the -kill() method on all the sprites. This means the last reference to each sprite -is probably in the returned list. Once the list goes away so do the sprites. -A quick example of using this in a loop,<br> - - <pre> >>> for bomb in sprite.spritecollide(player, bombs, 1):<br> ... boom_sound.play()<br> ... Explosion(bomb, 0)<br></pre> - This finds all the sprites in the "bomb" group that collide with the player. -Because of the "dokill" argument it deletes all the crashed bombs. For each -bomb that did collide, it plays a "boom" sound effect, and creates a new Explosion -where the bomb was. (Note, the Explosion class here knows to add each instance -to the appropriate class, so we don't need to store it in a variable, that -last line might feel a little "funny" to you python programmers.<br> - <br> - <b>groupcollide(group1, group2, dokill1, dokill2) -> dictionary</b><br> - This is similar to the spritecollide function, but a little more complex. -It checks for collisions for all the sprites in one group, to the sprites -in another. There is a dokill argument for the sprites in each list. When -dokill1 is true, the colliding sprites in group1 will be kill()ed. When dokill2 -is true, we get the same results for group2. The dictionary it returns works -like this; each key in the dictionary is a sprite from group1 that had a collision. -The value for that key is a list of the sprites that it collided with. Perhaps -another quick code sample explains it best<br> - - <pre> >>> for alien in sprite.groupcollide(aliens, shots, 1, 1).keys() - ... boom_sound.play() - ... Explosion(alien, 0) - ... kills += 1 -</pre> - This code checks for the collisions between player bullets and all the aliens -they might intersect. In this case we only loop over the dictionary keys, -but we could loop over the values() or items() if we wanted to do something -to the specific shots that collided with aliens. If we did loop over the values() -we would be looping through lists that contain sprites. The same sprite may -even appear more than once in these different loops, since the same "shot" -could have collided against multiple "aliens".<br> - <br> - <br> - </blockquote> - Those are the basic collision functions that come with pygame. It should -be easy to roll your own that perhaps use something differen than the "rect" -attribute. Or maybe try to fine-tweak your code a little more by directly -effecting the collision object, instead of building a list of the collision? -The code in the sprite collision functions is very optimized, but you could -speed it up slightly by taking out some functionality you don't need.<br> - <br> - - <h2>Common Problems</h2> - <p>Currently there is one main problem that catches new users. When you -derive your new sprite class with the Sprite base, you <b>must</b> call the -Sprite.__init__() method from your own class __init__() method. If you forget -to call the Sprite.__init__() method, you get a cryptic error, like this; -<tt>AttributeError: 'mysprite' instance has no attribute '_Sprite__g'</tt>. -</p> - <br> - - <h2>Extending Your Own Classes <i>(Advanced)</i></h2> - - <p>Because of speed concerns, the current Group classes try to -only do exactly what they need, and not handle a lot of general situations. If you -decide you need extra features, you may want to create your own Group class.</p> - - <p>The Sprite and Group classes were designed to be extended, so feel free -to create your own Group classes to do specialized things. The best place to start -is probably the actual python source code for the sprite module. Looking at the -current Sprite groups should be enough example on how to create your own.</p> - - <p>For example, here is the source code for a rendering Group that calls a -render() method for each sprite, instead of just blitting an "image" variable from it. -Since we want it to also handle updated areas, we will start with a copy of the original -RenderUpdates group, here is the code: -<pre> -class RenderUpdatesDraw(RenderClear): - """call sprite.draw(screen) to render sprites""" - def draw(self, surface): - dirty = self.lostsprites - self.lostsprites = [] - for s, r in self.spritedict.items(): - newrect = s.draw(screen) #Here's the big change - if r is 0: - dirty.append(newrect) - else: - dirty.append(newrect.union(r)) - self.spritedict[s] = newrect - return dirty -</pre></p> - - <p>Following is more information on how you could create your own Sprite -and Group objects from scratch. </p> - - <p>The Sprite objects only "require" two methods. "add_internal()" and "remove_internal()". -These are called by the Group classes when they are removing a sprite from -themselves. The add_internal() and remove_internal() have a single argument -which is a group. Your Sprite will need some way to also keep -track of the Groups it belongs to. You will likely want to try to match the -other methods and arguments to the real Sprite class, but if you're not going -to use those methods, you sure don't need them.</p> - - <p>It is almost the same requirements for creating your own Group. In -fact, if you look at the source you'll see the GroupSingle isn't derived from -the Group class, it just implements the same methods so you can't really tell -the difference. Again you need an "add_internal()" and "remove_internal()" method -that the sprites call when they want to belong or remove themselves from -the group. The add_internal() and remove_internal() have a single argument -which is a sprite. The only other requirement for the Group classes is they -have a dummy attribute named "_spritegroup". It doesn't matter what the value -is, as long as the attribute is present. The Sprite classes can look for this -attribute to determine the difference between a "group" and any ordinary python -container. (This is important, because several sprite methods can take an -argument of a single group, or a sequence of groups. Since they both look -similar, this is the most flexible way to "see" the difference.)</p> - - <p>You should through the code for the sprite module. While -the code is a bit "tuned", it's got enough comments to help you follow along. -There's even a todo section in the source if you feel like contributing.</p> - -</body></html>
--- a/docs/tut/newbieguide.html Wed Jan 09 19:26:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,210 +0,0 @@ -<!-- -TUTORIAL:David Clark's Newbie Guide To Pygame ---><html> -<title>A Newbie Guide to pygame</title> - -<body bgcolor="#FFFFFF" text="#000000"> -<div align="center"> -<H2>A Newbie Guide to pygame</H2> - -<H4>or</H4> - -<H2>Things I learned by trial and error so you don't have to.</H2> - -<H4>or</H4> - -<H2>How I learned to stop worrying and love the blit.</H2> -</div> - - -<p><a href="http://www.pygame.org/">Pygame</a> is a python wrapper for <a href="http://www.libsdl.org">SDL</a>, written by Pete Shinners. What this means is that, using pygame, you can write games or other multimedia applications in Python that will run unaltered on any of SDL's supported platforms (Windows, Unix, Mac, beOS and others).</p> - -<p>Pygame may be easy to learn, but the world of graphics programming can be pretty confusing to the newcomer. I wrote this to try to distill the practical knowledge I've gained over the past year or so of working with pygame, and it's predecessor, pySDL. I've tried to rank these suggestions in order of importance, but how relevent any particular hint is will depend on your own background and the details of your project.</p> - - -<H3>1. Get comfortable working in Python.</H3> - -<p>The most important thing is to feel confident using python. Learning something as potentially complicated as graphics programming will be a real chore if you're also unfamiliar with the language you're using. Write a few sizable non-graphical programs in python - parse some text files, write a guessing game or a journal-entry program or something. Get comfortable with string and list manipulation - know how to split, slice and combine strings and lists. Know how <b>import</b> works - try writing a program that is spread across several source files. Write your own functions, and practice manipulating numbers and characters; know how to convert between the two. Get to the point where the syntax for using lists and dictionaries is second-nature - you don't want to have to run to the documentation every time you need to slice a list or sort a set of keys. Resist the temptation to run to a mailing list, comp.lang.python, or irc when you run into trouble. Instead, fire up the interpreter and play with the problem for a few hours. Print out the <a href="http://www.brunningonline.net/simon/python/quick-ref2_0.html">Python 2.0 Quick Reference</a> and keep it by your computer.</p> - -<p>This may sound incredibly dull, but the confidence you'll gain through your familiarity with python will work wonders when it comes time to write your game. The time you spend making python code second-nature will be nothing compared to the time you'll save when you're writing real code.</p> - - -<h3>2. Recognize which parts of pygame you really need.</h3> - -<p>Looking at the jumble of classes at the top of the pygame Documentation index may be confusing. The important thing is to realize that you can do a great deal with only a tiny subset of functions. Many classes you'll probably never use - in a year, I haven't touched the Channel, Joystick, cursors, Userrect, surfarray or version functions.</p> - - -<H3>3. Know what a surface is</H3> - -<p>The most important part of pygame is the surface. Just think of a surface as a blank piece of paper. You can do a lot of things with a surface - you can draw lines on it, fill parts of it with color, copy images to and from it, and set or read individual pixel colors on it. A surface can be any size (within reason) and you can have as many of them as you like (again, within reason). One surface is special - the one you create with <b>pygame.display.set_mode()</b>. This 'display surface' represents the screen; whatever you do to it will appear on the user's screen. You can only have one of these - that's an SDL limitation, not a pygame one.</p> - -<P>So how do you create surfaces? As mentioned above, you create the special 'display surface' with <b>pygame.display.set_mode()</b>. You can create a surface that contains an image by using <b>image.load()</b>, or you can make a surface that contains text with <b>font.render()</b>. You can even create a surface that contains nothing at all with <b>Surface()</b>.</p> - -<p>Most of the surface functions are not critical. Just learn <b>blit()</b>, <b>fill()</b>, <b>set_at()</b> and <b>get_at()</b>, and you'll be fine.</p> - - -<H3>4. Use surface.convert()</H3> - -<p>When I first read the documentation for <b>surface.convert()</b>, I didn't think it was something I had to worry about. "I only use pngs, therefore everything I do will be in the same format. So I don't need convert()". It turns out I was very, very wrong.</p> - -<p>The 'format' that <b>convert()</b> refers to isn't the <i>file</i> format (ie png, jpeg, gif), it's what's called the 'pixel format'. This refers to the particular way that a surface records individual colors in a specific pixel. If the surface format isn't the same as the display format, SDL will have to convert it on-the-fly for every blit - a fairly time-consuming process. Don't worry too much about the explanation; just note that <b>convert()</b> is necessary if you want to get any kind of speed out of your blits.</p> - -<p>How do you use convert? Just call it after creating a surface with the <b>image.load()</b> function. Instead of just doing:</p> - -<pre>surface = pygame.image.load('foo.png')</pre> - -<p>Do:</p> - -<pre>surface = pygame.image.load('foo.png').convert()</pre> - -<p>It's that easy. You just need to call it once per surface, when you load an image off the disk. You'll be pleased with the results; I see about a 6x increase in blitting speed by calling <b>convert()</b>.</p> - -<p>The only times you don't want to use <b>convert()</b> is when you really need to have absolute control over an image's internal format - say you were writing an image conversion program or something, and you needed to ensure that the output file had the same pixel format as the input file. If you're writing a game, you need speed. Use <b>convert()</b>.</p> - - -<h3>5. Dirty rect animation</H3> - -<p>The most common cause of inadequate frame rates in pygame programs results from misunderstanding the <b>pygame.display.update()</b> function. With pygame, merely drawing something to the display surface doesn't cause it to appear on the screen - you need to call <b>pygame.display.update()</b>. There are three ways of calling this function:</p> - -<OL> - <LI><b>pygame.display.update()</b> - This updates the whole window (or the whole screen for fullscreen displays). - <LI><b>pygame.display.flip()</b> - This does the same thing, and will also do the right thing if you're using doublebuffered hardware acceleration, which you're not, so on to... - <LI><b>pygame.display.update(a rectangle or some list of rectangles)</b> - This updates just the rectangular areas of the screen you specify. -</OL> - -<p>Most people new to graphics programming use the first option - they update the whole screen every frame. The problem is that this is unacceptably slow for most people. Calling <b>update()</b> takes 35 milliseconds on my machine, which doesn't sound like much, until you realize that 1000 / 35 = 28 frames per second <i>maximum</i>. And that's with no game logic, no blits, no input, no AI, nothing. I'm just sitting there updating the screen, and 28 fps is my maximum framerate. Ugh.</p> - -<p>The solution is called 'dirty rect animation'. Instead of updating the whole screen every frame, only the parts that changed since the last frame are updated. I do this by keeping track of those rectangles in a list, then calling <b>update(the_dirty_rectangles)</b> at the end of the frame. In detail for a moving sprite, I:</p> - -<OL> - <LI>Blit a piece of the background over the sprite's current location, erasing it. - <LI>Append the sprite's current location rectangle to a list called dirty_rects. - <LI>Move the sprite. - <LI>Draw the sprite at it's new location. - <LI>Append the sprite's new location to my dirty_rects list. - <LI>Call <B>display.update(dirty_rects)</b> -</OL> - -<p>The difference in speed is astonishing. Consider that <a href="http://shredwheat.zopesite.com/solarwolf">Solarwolf</a> has dozens of constantly moving sprites updating smoothly, and still has enough time left over to display a parallax starfield in the background, and update that too.</p> - -<p>There are two cases where this technique just won't work. The first is where the whole window or screen really is being updated every frame - think of a smooth-scrolling engine like an overhead real-time strategy game or a side-scroller. So what do you do in this case? Well, the short answer is - don't write this kind of game in pygame. The long answer is to scroll in steps of several pixels at a time; don't try to make scrolling perfectly smooth. Your player will appreciate a game that scrolls quickly, and won't notice the background jumping along too much.</p> - -<p>A final note - not every game requires high framerates. A strategic wargame could easily get by on just a few updates per second - in this case, the added complexity of dirty rect animation may not be necessary.</p> - - -<h3>6. There is NO rule six.</h3> - - -<h3>7. Hardware surfaces are more trouble than they're worth.</h3> - -<p>If you've been looking at the various flags you can use with <b>pygame.display.set_mode()</b>, you may have thought like this: "Hey, HWSURFACE! Well, I want that - who doesn't like hardware acceleration. Ooo... DOUBLEBUF; well, that sounds fast, I guess I want that too!". It's not your fault; we've been trained by years of 3-d gaming to believe that hardware acceleration is good, and software rendering is slow.</p> - -<p>Unfortunately, hardware rendering comes with a long list of drawbacks:</p> - -<UL> - <LI>It only works on some platforms. Windows machines can usually get hardware surfaces if you ask for them. Most other platforms can't. Linux, for example, may be able to provide a hardware surface if X4 is installed, if DGA2 is working properly, and if the moons are aligned correctly. If a hardware surface is unavailable, sdl will silently give you a software surface instead. - - <LI>It only works fullscreen. - - <LI>It complicates per-pixel access. If you have a hardware surface, you need to Lock the surface before writing or reading individual pixel values on it. If you don't, Bad Things Happen. Then you need to quickly Unlock the surface again, before the OS gets all confused and starts to panic. Most of this process is automated for you in pygame, but it's something else to take into account. - - <LI>You lose the mouse pointer. If you specify HWSURFACE (and actually get it), your pointer will usually just vanish (or worse, hang around in a half-there, half-not flickery state). You'll need to create a sprite to act as a manual mouse pointer, and you'll need to worry about pointer acceleration and sensitivity. What a pain. - - <LI>It might be slower anyway. Many drivers are not accelerated for the types of drawing that we do, and since everything has to be blitted across the video bus (unless you can cram your source surface into video memory as well), it might end up being slower than software access anyway. -</UL> - -<p>Hardware rendering has it's place. It works pretty reliably under Windows, so if you're not interested in cross-platform performance, it may provide you with a substantial speed increase. However, it comes at a cost - increased headaches and complexity. It's best to stick with good old reliable SWSURFACEs until you're sure you know what you're doing.</p> - - -<h3>8. Don't get distracted by side issues.</h3> - -<p>Sometimes, new game programmers spend too much time worrying about issues that aren't really critical to their game's success. The desire to get secondary issues 'right' is understandable, but early in the process of creating a game, you cannot even know what the important questions are, let alone what answers you should choose. The result can be a lot of needless prevarication.</p> - -<p>For example, consider the question of how to organize your graphics files. Should each frame have its own graphics file, or each sprite? Perhaps all the graphics should be zipped up into one archive? A great deal of time has been wasted on a lot of projects, asking these questions on mailing lists, debating the answers, profiling, etc, etc. This is a secondary issue; any time spent discussing it should have been spent coding the actual game.</p> - -<p>The insight here is that it is far better to have a 'pretty good' solution that was actually implemented, than a perfect solution that you never got around to writing.</p> - - -<h3>9. Rects are your friends.</h3> - -<p>Pete Shinners' wrapper may have cool alpha effects and fast blitting speeds, but I have to admit my favorite part of pygame is the lowly Rect class. A rect is simply a rectangle - defined only by the position of its top left corner, its width, and its height. Many pygame functions take rects as arguments, and they also take 'rectstyles', a sequence that has the same values as a rect. So if I need a rectangle that defines the area between 10, 20 and 40, 50, I can do any of the following:</p> - -<pre> -rect = pygame.Rect(10, 20, 30, 30) -rect = pygame.Rect((10, 20, 30, 30)) -rect = pygame.Rect((10, 20), (30, 30)) -rect = (10, 20, 30, 30) -rect = ((10, 20, 30, 30)) -</pre> - -<p>If you use any of the first three versions, however, you get access to Rect's utility functions. These include functions to move, shrink and inflate rects, find the union of two rects, and a variety of collision-detection functions.</p> - -<p>For example, suppose I'd like to get a list of all the sprites that contain a point (x, y) - maybe the player clicked there, or maybe that's the current location of a bullet. It's simple if each sprite has a .rect member - I just do:</p> - -<pre> -sprites_clicked = [sprite for sprite in all_my_sprites_list if sprite.rect.collidepoint(x, y)] -</pre> - -<p>Rects have no other relation to surfaces or graphics functions, other than the fact that you can use them as arguments. You can also use them in places that have nothing to do with graphics, but still need to be defined as rectangles. Every project I discover a few new places to use rects where I never thought I'd need them.</p> - - -<h3>10. Don't bother with pixel-perfect collision detection.</h3> - -<p>So you've got your sprites moving around, and you need to know whether or not they're bumping into one another. It's tempting to write something like the following: - -<OL> - <LI>Check to see if the rects are in collision. If they aren't, ignore them. - <LI>For each pixel in the overlapping area, see if the corresponding pixels from both sprites are opaque. If so, there's a collision. -</OL> - -<p>There are other ways to do this, with ANDing sprite masks and so on, but any way you do it in pygame, it's probably going to be too slow. For most games, it's probably better just to do 'sub-rect collision' - create a rect for each sprite that's a little smaller than the actual image, and use that for collisions instead. It will be much faster, and in most cases the player won't notice the inprecision.</p> - - -<h3>11. Managing the event subsystem</h3> - -<p>Pygame's event system is kind of tricky. There are actually two different ways to find out what an input device (keyboard, mouse or joystick) is doing.</p> - -<p>The first is by directly checking the state of the device. You do this by calling, say, <b>pygame.mouse.get_pos()</b> or <b>pygame.key.get_pressed()</b>. This will tell you the state of that device <i>at the moment you call the function</i>.</p> - -<p>The second method uses the SDL event queue. This queue is a list of events - events are added to the list as they're detected, and they're deleted from the queue as they're read off.</p> - -<p>There are advantages and disadvantages to each system. State-checking (system 1) gives you precision - you know exactly when a given input was made - if <b>mouse.get_pressed([0])</b> is 1, that means that the left mouse button is down <i>right at this moment</i>. The event queue merely reports that the mouse was down at some time in the past; if you check the queue fairly often, that can be ok, but if you're delayed from checking it by other code, input latency can grow. Another advantage of the state-checking system is that it detects "chording" easily; that is, several states at the same time. If you want to know whether the t and f keys are down at the same time, just check:</p> - -<pre> -if (key.get_pressed[K_t] and key.get_pressed[K_f]): - print "Yup!" -</pre> - -<p>In the queue system, however, each keypress arrives in the queue as a completely separate event, so you'd need to remember that the t key was down, and hadn't come up yet, while checking for the f key. A little more complicated.</p> - -<p>The state system has one great weakness, however. It only reports what the state of the device is at the moment it's called; if the user hits a mouse button then releases it just before a call to <b>mouse.get_pressed()</b>, the mouse button will return 0 - <b>get_pressed()</b> missed the mouse button press completely. The two events, MOUSEBUTTONDOWN and MOUSEBUTTONUP, will still be sitting in the event queue, however, waiting to be retrieved and processed.</p> - -<p>The lesson is: choose the system that meets your requirements. If you don't have much going on in your loop - say you're just sitting in a '<b>while 1</b>' loop, waiting for input, use <b>get_pressed()</b> or another state function; the latency will be lower. On the other hand, if every keypress is crucial, but latency isn't as important - say your user is typing something in an editbox, use the event queue. Some keypresses may be slightly late, but at least you'll get them all.</p> - -<p>A note about <b>event.poll()</b> vs. <b>wait()</b> - <b>poll()</b> may seem better, since it doesn't block your program from doing anything while it's waiting for input - <b>wait()</b> suspends the program until an event is received. However, <b>poll()</b> will consume 100% of available cpu time while it runs, and it will fill the event queue with NOEVENTS. Use <b>set_blocked()</b> to select just those event types you're interested in - your queue will be much more manageable.</p> - - -<h3>12. Colorkey vs. Alpha</h3> - -<p>There's a lot of confusion around these two techniques, and much of it comes from the terminology used.</p> - -<p>'Colorkey blitting' involves telling pygame that all pixels of a certain color in a certain image are transparent instead of whatever color they happen to be. These transparent pixels are not blitted when the rest of the image is blitted, and so don't obscure the background. This is how we make sprites that aren't rectangular in shape. Simply call <b>surface.set_colorkey(color)</b>, where color is a rgb tuple - say (0,0,0). This would make every pixel in the source image transparent instead of black.</p> - -<p>'Alpha' is different, and it comes in two flavors. 'Image alpha' applies to the whole image, and is probably what you want. Properly known as 'translucency', alpha causes each pixel in the source image to be only <i>partially</i> opaque. For example, if you set a surface's alpha to 192 and then blitted it onto a background, 3/4 of each pixel's color would come from the source image, and 1/4 from the background. Alpha is measured from 255 to 0, where 0 is completely transparent, and 255 is completely opaque. Note that colorkey and alpha blitting can be combined - this produces an image that is fully transparent in some spots, and semi-transparent in others.</p> - -<p>'Per-pixel alpha' is the other flavor of alpha, and it's more complicated. Basically, each pixel in the source image has its own alpha value, from 0 to 255. Each pixel, therefore, can have a different opacity when blitted onto a background. This type of alpha can't be mixed with colorkey blitting, and it overrides per-image alpha. Per-pixel alpha is rarely used in games, and to use it you have to save your source image in a graphic editor with a special <i>alpha channel</i>. It's complicated - don't use it yet.</p> - - -<h3>13. Do things the pythony way.</h3> - -<p>A final note (this isn't the least important one; it just comes at the end). Pygame is a pretty lightweight wrapper around SDL, which is in turn a pretty lightweight wrapper around your native OS graphics calls. Chances are pretty good that if your code is still slow, and you've done the things I've mentioned above, then the problem lies in the way you're addressing your data in python. Certain idioms are just going to be slow in python no matter what you do. Luckily, python is a very clear language - if a piece of code looks awkward or unweildy, chances are its speed can be improved, too. Read over <a href="http://musi-cal.mojam.com/~skip/python/fastpython.html">Python Performance Tips</a> for some great advice on how you can improve the speed of your code. That said, premature optimisation is the root of all evil; if it's just not fast enough, don't torture the code trying to make it faster. Some things are just not meant to be :)</p> - - -<p>There you go. Now you know practically everything I know about using pygame. Now, go write that game!</p> - -<hr> - -<p>David Clark is an avid pygame user and the editor of the Pygame Code Repository, a showcase for community-submitted python game code. He is also the author of Twitch, an entirely average pygame arcade game.</p> - -</body> -</html>
