~ubuntu-branches/ubuntu/warty/pygame/warty

« back to all changes in this revision

Viewing changes to docs/ref/pygame_sprite.html

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-09-17 17:09:53 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040917170953-caomeukd8awvvpwv
Tags: 1.6-0.2ubuntu1
Add missing build-depends: python

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
<a href=pygame_mixer_music.html>mixer_music</a> ||<br>
30
30
|| <a href=pygame_mouse.html>mouse</a> || 
31
31
<a href=pygame_movie.html>movie</a> || 
 
32
<a href=pygame_sndarray.html>sndarray</a> || 
32
33
<a href=pygame_surfarray.html>surfarray</a> || 
33
34
<a href=pygame_time.html>time</a> || 
34
35
<a href=pygame_transform.html>transform</a> ||<br>
41
42
|| <a href=Rect.html>Rect</a> || 
42
43
<a href=Sound.html>Sound</a> || 
43
44
<a href=Surface.html>Surface</a> ||<br>
44
 
&nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
45
 
<a href=pygame_sprite.html>sprite</a> || 
46
 
<a href=pygame_version.html>version</a> ||<br>
 
45
&nbsp;<br>|| <a href=pygame_color.html>color</a> || 
 
46
<a href=pygame_cursors.html>cursors</a> || 
 
47
<a href=pygame_sprite.html>sprite</a> ||<br>
47
48
 
48
49
 
49
50
</td></tr></table></td></tr></table>
69
70
<br>&nbsp;<br>
70
71
You can manage the relationship between groups and sprites
71
72
from both the groups and the actual sprite classes. Both
72
 
have add() and remove() functions that let you add sprites
 
73
have <a href=pygame_color.html#add>add()</a> and remove() functions that let you add sprites
73
74
to groups and groups to sprites. Both have initializing
74
75
functions that can accept a list of containers or sprites.
75
76
<br>&nbsp;<br>
99
100
<b>(class)</b> - the Group class is a container for sprites</td></tr>
100
101
 
101
102
 
102
 
<tr><td><a href=#Group.__len__>Group.__len__</a></td><td> -
103
 
           number of sprites in group</td></tr>
104
 
 
105
 
 
106
 
<tr><td><a href=#Group.__nonzero__>Group.__nonzero__</a></td><td> -
107
 
           ask if group is empty</td></tr>
108
 
 
109
 
 
110
103
<tr><td><a href=#Group.add>Group.add</a></td><td> -
111
104
           add sprite to group</td></tr>
112
105
 
221
214
           sprite or sequence of sprites to be contained.
222
215
</ul><br>&nbsp;<br>
223
216
 
224
 
<a name=Group.__len__><font size=+2><b>Group.__len__
225
 
</b></font><br><font size=+1><tt>
226
 
pygame.sprite.Group.__len__() -> int
227
 
</tt></font><ul>
228
 
           Returns the number of sprites contained in the group.
229
 
</ul><br>&nbsp;<br>
230
 
 
231
 
<a name=Group.__nonzero__><font size=+2><b>Group.__nonzero__
232
 
</b></font><br><font size=+1><tt>
233
 
pygame.sprite.Group.__nonzero__() -> bool
234
 
</tt></font><ul>
235
 
           Returns true if the group has any sprites. This
236
 
           lets you check if the group has any sprites by
237
 
           using it in a logical if statement.
238
 
</ul><br>&nbsp;<br>
239
 
 
240
217
<a name=Group.add><font size=+2><b>Group.add
241
218
</b></font><br><font size=+1><tt>
242
219
pygame.sprite.Group.add(sprite)
288
265
</b></font><br><font size=+1><tt>
289
266
pygame.sprite.Group.update(...)
290
267
</tt></font><ul>
291
 
           calls the update method for all sprites in
292
 
           the group. any arguments are passed to the update
293
 
           function.
 
268
           calls the update method for all sprites in the group.
 
269
           Passes all arguments on to the Sprite update function.
294
270
</ul><br>&nbsp;<br>
295
271
 
296
272
<a name=GroupSingle><font size=+2><b>GroupSingle
324
300
</tt></font><ul>
325
301
           Clears the area of all drawn sprites. the bgd
326
302
           argument should be Surface which is the same
327
 
           dimensions as the surface.
 
303
           dimensions as the surface. The bgd can also be
 
304
           a function which gets called with the passed
 
305
           surface and the area to be cleared.
328
306
</ul><br>&nbsp;<br>
329
307
 
330
308
<a name=RenderClear.draw><font size=+2><b>RenderClear.draw
456
434
       given a sprite and a group of sprites, this will
457
435
       return a list of all the sprites that intersect
458
436
       the given sprite.
459
 
       all sprites must have a "rect" method, which is a
 
437
       all sprites must have a "rect" value, which is a
460
438
       rectangle of the sprite area. if the dokill argument
461
439
       is true, the sprites that do collide will be
462
440
       automatically removed from all groups.
470
448
       return return any single sprite that collides with
471
449
       with the given sprite. If there are no collisions
472
450
       this returns None.
473
 
       
 
451
<br>&nbsp;<br>
474
452
       if you don't need all the features of the
475
453
       spritecollide function, this function will be a
476
454
       bit quicker.
477
 
       
478
 
       all sprites must have a "rect" method, which is a
479
 
       rectangle of the sprite area. if the dokill argument
480
 
       is true, the sprites that do collide will be
481
 
       automatically removed from all groups.
 
455
<br>&nbsp;<br>
 
456
       all sprites must have a "rect" value, which is a
 
457
       rectangle of the sprite area.
482
458
</ul><br>&nbsp;<br>
483
459
 
484
460