1. pygame
  2. Untitled project
  3. pygame

Commits

marcus  committed 9e7ae3e

Fixed docs for mask module and cleaned up namespace pollution.

  • Participants
  • Parent commits db2a57c
  • Branches default

Comments (0)

Files changed (6)

File docs/ref/index.html

View file
  • Ignore whitespace
 </ul>
 <li><a href="mask.html#pygame.mask">pygame.mask</a> - <font size=-1>pygame module for image masks.</font></li>
 <ul>
+<li><a href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></li>
 <li><a href="mask.html#pygame.mask.get_at">pygame.mask.get_at</a> - <font size=-1>Returns nonzero if the bit at (x,y) is set.</font></li>
 <li><a href="mask.html#pygame.mask.get_bounding_rects">pygame.mask.get_bounding_rects</a> - <font size=-1>Returns a list of bounding rects of regions of set pixels.</font></li>
 <li><a href="mask.html#pygame.mask.get_size">pygame.mask.get_size</a> - <font size=-1>Returns the size of the mask.</font></li>
+<li><a href="mask.html#pygame.mask.Mask">pygame.mask.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></li>
 <li><a href="mask.html#pygame.mask.overlap">pygame.mask.overlap</a> - <font size=-1>Returns the point of intersection if the masks overlap with the given offset - or None if it does not overlap.</font></li>
 <li><a href="mask.html#pygame.mask.overlap_area">pygame.mask.overlap_area</a> - <font size=-1>Returns the number of overlapping 'pixels'.</font></li>
-<li><a href="mask.html#pygame.mask.pygame.Mask">pygame.mask.pygame.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></li>
-<li><a href="mask.html#pygame.mask.pygame.mask.from_surface">pygame.mask.pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></li>
 <li><a href="mask.html#pygame.mask.set_at">pygame.mask.set_at</a> - <font size=-1>Sets the position in the mask given by x and y.</font></li>
 </ul>
 <li><a href="mixer.html#pygame.mixer">pygame.mixer</a> - <font size=-1>pygame module for loading and playing sounds</font></li>

File docs/ref/mask.html

View file
  • Ignore whitespace
 <big><b>pygame.mask</big></b><br><ul>
   <i>pygame module for image masks.</i><br>
 <ul><small><table>
-  <tr><td><a href="mask.html#pygame.mask.pygame.mask.from_surface">pygame.mask.pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></td><td>Returns a Mask from the given surface.</td></tr>
-  <tr><td><a href="mask.html#pygame.mask.pygame.Mask">pygame.mask.pygame.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></td><td>pygame object for representing 2d bitmasks</td></tr>
+  <tr><td><a href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></td><td>Returns a Mask from the given surface.</td></tr>
+  <tr><td><a href="mask.html#pygame.mask.Mask">pygame.mask.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></td><td>pygame object for representing 2d bitmasks</td></tr>
   <tr><td><a href="mask.html#pygame.mask.get_size">pygame.mask.get_size</a> - <font size=-1>Returns the size of the mask.</font></td><td>Returns the size of the mask.</td></tr>
   <tr><td><a href="mask.html#pygame.mask.get_at">pygame.mask.get_at</a> - <font size=-1>Returns nonzero if the bit at (x,y) is set.</font></td><td>Returns nonzero if the bit at (x,y) is set.</td></tr>
   <tr><td><a href="mask.html#pygame.mask.set_at">pygame.mask.set_at</a> - <font size=-1>Sets the position in the mask given by x and y.</font></td><td>Sets the position in the mask given by x and y.</td></tr>
 <!--COMMENTS:pygame.mask--> &nbsp;<br> 
 
 
-<a name="pygame.mask.pygame.mask.from_surface">
-<big><b>pygame.mask.pygame.mask.from_surface</big></b><br><ul>
+<a name="pygame.mask.from_surface">
+<big><b>pygame.mask.from_surface</big></b><br><ul>
   <i>Returns a Mask from the given surface.</i><br>
   <tt>pygame.mask.from_surface(Surface, threshold = 127) -> Mask</tt><br>
 <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>
-<!--COMMENTS:pygame.mask.pygame.mask.from_surface--> &nbsp;<br> 
+<!--COMMENTS:pygame.mask.from_surface--> &nbsp;<br> 
 <br></ul>
 
 
-<a name="pygame.mask.pygame.Mask">
-<big><b>pygame.mask.pygame.Mask</big></b><br><ul>
+<a name="pygame.mask.Mask">
+<big><b>pygame.mask.Mask</big></b><br><ul>
   <i>pygame object for representing 2d bitmasks</i><br>
   <tt>pygame.Mask((width, height): return Mask</tt><br>
  &nbsp;<br> 
-<!--COMMENTS:pygame.mask.pygame.Mask--> &nbsp;<br> 
+<!--COMMENTS:pygame.mask.Mask--> &nbsp;<br> 
 <br></ul>
 
 

File lib/__init__.py

View file
  • Ignore whitespace
 try: from pygame.surface import *
 except (ImportError,IOError):Surface = lambda:Missing_Function
 
-try: from pygame.mask import *
+try:
+    import pygame.mask
+    from pygame.mask import Mask
 except (ImportError,IOError):Mask = lambda:Missing_Function
 
 try: from pygame.pixelarray import *

File src/mask.c

View file
  • Ignore whitespace
 {
     PyObject_HEAD_INIT(NULL)
     0,
-    "Mask",
+    "pygame.mask.Mask",
     sizeof(PyMaskObject),
     0,
     mask_dealloc,
     (ternaryfunc)NULL,
     (reprfunc)NULL,
     0L,0L,0L,0L,
-    DOC_PYGAMEMASK /* Documentation string */
+    DOC_PYGAMEMASKMASK /* Documentation string */
 };
 
 
 
 static PyMethodDef mask_builtins[] =
 {
-    { "Mask", Mask, METH_VARARGS, DOC_PYGAMEMASK },
+    { "Mask", Mask, METH_VARARGS, DOC_PYGAMEMASKMASK },
     { "from_surface", mask_from_surface, METH_VARARGS,
-      DOC_PYGAMEMASKPYGAMEMASKFROMSURFACE},
+      DOC_PYGAMEMASKFROMSURFACE},
     { NULL, NULL, 0, NULL }
 };
 

File src/mask.doc

View file
  • Ignore whitespace
 New in pygame 1.8.
 <SECTION>
 
-pygame.mask.from_surface
+from_surface
 Returns a Mask from the given surface.
 pygame.mask.from_surface(Surface, threshold = 127) -> Mask
 
 If the Surface is color keyed, then threshold is not used.
 <END>
 
-pygame.Mask
+Mask
 pygame object for representing 2d bitmasks
 pygame.Mask((width, height): return Mask
 <END>

File src/pygamedocs.h

View file
  • Ignore whitespace
 
 #define DOC_PYGAMEMASK "pygame module for image masks."
 
-#define DOC_PYGAMEMASKPYGAMEMASKFROMSURFACE "pygame.mask.from_surface(Surface, threshold = 127) -> Mask\nReturns a Mask from the given surface."
+#define DOC_PYGAMEMASKFROMSURFACE "pygame.mask.from_surface(Surface, threshold = 127) -> Mask\nReturns a Mask from the given surface."
 
-#define DOC_PYGAMEMASKPYGAMEMASK "pygame.Mask((width, height): return Mask\npygame object for representing 2d bitmasks"
+#define DOC_PYGAMEMASKMASK "pygame.Mask((width, height): return Mask\npygame object for representing 2d bitmasks"
 
 #define DOC_PYGAMEMASKGETSIZE "Mask.get_size() -> width,height\nReturns the size of the mask."