Merge branch 'master' of git.ucc.asn.au:/matches/honours
[matches/honours.git] / research / transmission_spectroscopy / simulator / pgu-0.18 / docs / vid.html
1 <html>
2 <head>
3 <title>vid</title>
4 <style type='text/css'><!--
5 .sections { 
6         border: 1px solid black;
7         background: #fef790;
8         margin-left: 8px;
9         }
10         
11 .sections th {
12         background: #fde42d; 
13         }
14         
15 .sections .h1 {
16         padding: 2px;
17         padding-left: 0px;
18         }
19 .sections .h2 {
20         padding: 2px;
21         padding-left: 16px;
22         }
23 .sections .h3 {
24         padding: 2px;
25         padding-left: 32px;
26         }
27 .sections .h4 {
28         padding: 2px;
29         padding-left: 48px;
30         }
31         
32 .sections .h5 {
33         padding: 2px;
34         padding-left: 64px;
35         }
36 .sections .h6 {
37         padding: 2px;
38         padding-left: 72px;
39         }
40
41 .wiki h1, .wiki h2, .wiki h3, .wiki h4, .wiki h5, .wiki h6 {
42         border: 0px;
43         padding: 0px;
44         background: none;
45         border-bottom: 1px solid #bbbbbb;
46
47         }
48         
49 .wiki div.h1 {
50     }
51 .wiki div.h2 {
52     }
53     
54 .wiki dt {
55     font-style: italic;
56     }
57     
58 .wiki dd,dd,p.dd {
59     font-style: normal;
60     margin-left: 48px;
61     margin-top: 0px;
62     margin-bottom: 8px;
63     display: block;
64     }
65     
66 .wiki h3 {
67     margin-left: 48px; 
68     }
69 .wiki div.h3 {
70     margin-left: 48px;
71     }
72         
73 .wiki code, .wiki pre {
74     background: #eeeeee;
75     padding: 4px;
76     border: 1px dashed #888888;
77     }
78     
79     
80 .wiki table {
81     border-top: 1px solid #888888;
82     border-left: 1px solid #888888;
83     border-spacing: 0px; border-collapse: collapse;
84     }
85 .wiki td {
86     border-bottom: 1px solid #888888;
87     border-right: 1px solid #888888;
88     padding: 3px;
89     }
90 .wiki th {
91     background: #eeeeee;
92     border-bottom: 1px solid #888888;
93     border-right: 1px solid #888888;
94     padding: 3px;
95     }
96
97 -->
98 </style>
99
100 </head>
101 <body>
102 <div align='center'>
103
104 <table cellpadding=8><tr><td>
105 <a href='http://www.imitationpickles.org/pgu/'><img src='skin/logo.gif' alt="Phil's pyGame Utilities" border=0></a>
106 <td style='font-size:48px'>Documentation
107 </table>
108
109 </div>
110
111 <hr width=500 align=center>
112
113 <table width='100%'><tr><td valign=top width=120 style='padding-right:6px;border-right: 1px solid black;'>
114 <a href='index.html'>Overview</a><br><br>
115 <strong>Scripts</strong><br>
116 <a href="tileedit.html">tileedit</a>
117  | <a href="leveledit.html">leveledit</a>
118  | <a href="tganew.html">tganew</a>
119  | <a href="levelfancy.html">levelfancy</a>
120 <br><br>
121 <strong>Reference</strong><br>
122 <a href="algo.html">algo</a>
123  | <a href="ani.html">ani</a>
124  | <a href="engine.html">engine</a>
125  | <a href="fonts.html">fonts</a>
126  | <a href="high.html">high</a>
127  | <a href="html.html">html</a>
128  | <a href="layout.html">layout</a>
129  | <a href="text.html">text</a>
130  | <a href="timer.html">timer</a>
131  | <a href="vid.html">vid</a>
132 <br><br>
133 <strong>Tutorials</strong><br>
134 <a href="tilevid1.html">1</a>
135  | <a href="tilevid2.html">2</a>
136  | <a href="tilevid3.html">3</a>
137  | <a href="tilevid4.html">4</a>
138  | <a href="tilevid5.html">5</a>
139 <br><br>
140 <strong>GUI&nbsp;Ref.</strong><br>
141 <a href="gui.theme.html">theme</a>
142  | <a href="gui.style.html">style</a>
143  | <a href="gui.widget.html">widget</a>
144  | <a href="gui.surface.html">surface</a>
145  | <a href="gui.const.html">const</a>
146 <br><br>
147 <strong>Containers</strong><br>
148 <a href="gui.container.html">container</a>
149  | <a href="gui.app.html">app</a>
150  | <a href="gui.table.html">table</a>
151  | <a href="gui.document.html">document</a>
152  | <a href="gui.area.html">area</a>
153 <br><br>
154 <strong>Forms</strong><br>
155 <a href="gui.form.html">form</a>
156  | <a href="gui.group.html">group</a>
157 <br><br>
158 <strong>Widgets</strong><br>
159 <a href="gui.basic.html">basic</a>
160  | <a href="gui.button.html">button</a>
161  | <a href="gui.input.html">input</a>
162  | <a href="gui.keysym.html">keysym</a>
163  | <a href="gui.slider.html">slider</a>
164  | <a href="gui.select.html">select</a>
165  | <a href="gui.misc.html">misc</a>
166 <br><br>
167 <strong>Other</strong><br>
168 <a href="gui.menus.html">menus</a>
169  | <a href="gui.dialog.html">dialog</a>
170 <br><br>
171 <strong>Tutorials</strong><br>
172 <a href="gui1.html">1</a>
173  | <a href="gui2.html">2</a>
174  | <a href="gui3.html">3</a>
175  | <a href="gui4.html">4</a>
176  | <a href="gui5.html">5</a>
177  | <a href="gui6.html">6</a>
178  | <a href="gui7.html">7</a>
179  | <a href="gui8.html">8</a>
180  | <a href="gui9.html">9</a>
181  | <a href="gui10.html">10</a>
182 <br><br>
183
184 <td valign=top style='padding-left:6px;'>
185
186 <h1>vid</h1>
187 <table class='sections' align=right>
188 <tr><th>sections</th>
189 <tr><td class='h1'><a href='#Sprite'>Sprite</a>
190 <tr><td class='h2'><a href='#Sprite.setimage'>Sprite.setimage</a>
191 <tr><td class='h1'><a href='#Tile'>Tile</a>
192 <tr><td class='h1'><a href='#Vid'>Vid</a>
193 <tr><td class='h2'><a href='#Vid.resize'>Vid.resize</a>
194 <tr><td class='h2'><a href='#Vid.set'>Vid.set</a>
195 <tr><td class='h2'><a href='#Vid.get'>Vid.get</a>
196 <tr><td class='h2'><a href='#Vid.paint'>Vid.paint</a>
197 <tr><td class='h2'><a href='#Vid.update'>Vid.update</a>
198 <tr><td class='h2'><a href='#Vid.tga_load_level'>Vid.tga_load_level</a>
199 <tr><td class='h2'><a href='#Vid.tga_save_level'>Vid.tga_save_level</a>
200 <tr><td class='h2'><a href='#Vid.tga_load_tiles'>Vid.tga_load_tiles</a>
201 <tr><td class='h2'><a href='#Vid.load_images'>Vid.load_images</a>
202 <tr><td class='h2'><a href='#Vid.run_codes'>Vid.run_codes</a>
203 <tr><td class='h2'><a href='#Vid.string2groups'>Vid.string2groups</a>
204 <tr><td class='h2'><a href='#Vid.list2groups'>Vid.list2groups</a>
205 <tr><td class='h2'><a href='#Vid.groups2list'>Vid.groups2list</a>
206 <tr><td class='h2'><a href='#Vid.loop'>Vid.loop</a>
207 <tr><td class='h2'><a href='#Vid.screen_to_tile'>Vid.screen_to_tile</a>
208 <tr><td class='h2'><a href='#Vid.tile_to_screen'>Vid.tile_to_screen</a>
209 </table>
210
211 <div class='wiki'>
212 <a name="">
213 <div class="h1">
214 Sprite and tile engine.
215
216 tilevid, isovid, hexvid are all subclasses of this interface.
217
218 Includes support for:
219
220 * Foreground Tiles
221 * Background Tiles
222 * Sprites
223 * Sprite-Sprite Collision handling
224 * Sprite-Tile Collision handling
225 * Scrolling
226 * Loading from PGU tile and sprite formats (optional)
227 * Set rate FPS (optional)
228
229 This code was previously known as the King James Version (named after the
230 Bible of the same name for historical reasons.)
231
232
233 </div>
234 <a name="Sprite">
235 <h2>Sprite</h2>
236 <div class="h2">
237 The object used for Sprites.
238
239 Arguments:
240     ishape -- an image, or an image, rectstyle.  The rectstyle will
241         describe the shape of the image, used for collision
242         detection.
243     pos -- initial (x,y) position of the Sprite.
244
245 Attributes:
246     rect -- the current position of the Sprite
247     _rect -- the previous position of the Sprite
248     groups -- the groups the Sprite is in
249     agroups -- the groups the Sprite can hit in a collision
250     hit -- the handler for hits -- hit(g,s,a)
251     loop -- the loop handler, called once a frame
252
253
254 </div>
255 <a name="Sprite.setimage">
256 <h3>Sprite.setimage</h3>
257 <div class="h3">
258 Set the image of the Sprite.
259
260 Arguments:
261     ishape -- an image, or an image, rectstyle.  The rectstyle will
262               describe the shape of the image, used for collision detection.
263
264
265 </div>
266 <a name="Tile">
267 <h2>Tile</h2>
268 <div class="h2">
269 Tile Object used by TileCollide.
270
271 Arguments:
272     image -- an image for the Tile.
273
274 Attributes:
275     agroups -- the groups the Tile can hit in a collision
276     hit -- the handler for hits -- hit(g,t,a)
277
278
279 </div>
280 <a name="Vid">
281 <h2>Vid</h2>
282 <div class="h2">
283 An engine for rendering Sprites and Tiles.
284
285 Attributes:
286     sprites -- a list of the Sprites to be displayed.  You may append and
287                remove Sprites from it.
288     images  -- a dict for images to be put in.
289     size    -- the width, height in Tiles of the layers.  Do not modify.
290     view    -- a pygame.Rect of the viewed area.  You may change .x, .y,
291                 etc to move the viewed area around.
292     bounds  -- a pygame.Rect (set to None by default) that sets the bounds
293                 of the viewable area.  Useful for setting certain borders
294                 as not viewable.
295     tlayer  -- the foreground tiles layer
296     clayer  -- the code layer (optional)
297     blayer  -- the background tiles layer (optional)
298     groups  -- a hash of group names to group values (32 groups max, as a tile/sprites
299             membership in a group is determined by the bits in an integer)
300
301
302 </div>
303 <a name="Vid.resize">
304 <h3>Vid.resize</h3>
305 <div class="h3">
306 Resize the layers.
307
308 Arguments:
309     size -- w,h in Tiles of the layers
310     bg   -- set to 1 if you wish to use both a foreground layer and a
311             background layer
312
313
314 </div>
315 <a name="Vid.set">
316 <h3>Vid.set</h3>
317 <div class="h3">
318 Set a tile in the foreground to a value.
319
320 Use this method to set tiles in the foreground, as it will make
321 sure the screen is updated with the change.  Directly changing
322 the tlayer will not guarantee updates unless you are using .paint()
323
324 Arguments:
325     pos -- (x,y) of tile
326     v -- value
327
328
329 </div>
330 <a name="Vid.get">
331 <h3>Vid.get</h3>
332 <div class="h3">
333 Get the tlayer at pos.
334
335 Arguments:
336     pos -- (x,y) of tile
337
338
339 </div>
340 <a name="Vid.paint">
341 <h3>Vid.paint</h3>
342 <div class="h3">
343 Paint the screen.
344
345 Arguments:
346     screen -- a pygame.Surface to paint to
347
348 Returns the updated portion of the screen (all of it)
349
350
351 </div>
352 <a name="Vid.update">
353 <h3>Vid.update</h3>
354 <div class="h3">
355 Update the screen.
356
357 Arguments:
358     screen -- a pygame.Rect to update
359
360 Returns a list of updated rectangles.
361
362
363 </div>
364 <a name="Vid.tga_load_level">
365 <h3>Vid.tga_load_level</h3>
366 <div class="h3">
367 Load a TGA level.
368
369 Arguments:
370     g        -- a Tilevid instance
371     fname    -- tga image to load
372     bg        -- set to 1 if you wish to load the background layer
373
374
375 </div>
376 <a name="Vid.tga_save_level">
377 <h3>Vid.tga_save_level</h3>
378 <div class="h3">
379 Save a TGA level.
380
381 Arguments:
382     fname -- tga image to save to
383
384
385 </div>
386 <a name="Vid.tga_load_tiles">
387 <h3>Vid.tga_load_tiles</h3>
388 <div class="h3">
389 Load a TGA tileset.
390
391 Arguments:
392     g       -- a Tilevid instance
393     fname    -- tga image to load
394     size    -- (w,h) size of tiles in pixels
395     tdata    -- tile data, a dict of tile:(agroups, hit handler, config)
396
397
398 </div>
399 <a name="Vid.load_images">
400 <h3>Vid.load_images</h3>
401 <div class="h3">
402 Load images.
403
404 Arguments:
405     idata -- a list of (name, fname, shape)
406
407
408 </div>
409 <a name="Vid.run_codes">
410 <h3>Vid.run_codes</h3>
411 <div class="h3">
412 Run codes.
413
414 Arguments:
415     cdata -- a dict of code:(handler function, value)
416     rect -- a tile rect of the parts of the layer that should have
417          their codes run
418
419
420 </div>
421 <a name="Vid.string2groups">
422 <h3>Vid.string2groups</h3>
423 <div class="h3">
424 Convert a string to groups.
425 </div>
426 <a name="Vid.list2groups">
427 <h3>Vid.list2groups</h3>
428 <div class="h3">
429 Convert a list to groups.
430 </div>
431 <a name="Vid.groups2list">
432 <h3>Vid.groups2list</h3>
433 <div class="h3">
434 Convert a groups to a list.
435 </div>
436 <a name="Vid.loop">
437 <h3>Vid.loop</h3>
438 <div class="h3">
439 Update and hit testing loop.  Run this once per frame.
440 </div>
441 <a name="Vid.screen_to_tile">
442 <h3>Vid.screen_to_tile</h3>
443 <div class="h3">
444 Convert a screen position to a tile position.
445 </div>
446 <a name="Vid.tile_to_screen">
447 <h3>Vid.tile_to_screen</h3>
448 <div class="h3">
449 Convert a tile position to a screen position.
450 </div>
451
452 </div>
453
454 </table>
455
456 <hr width=500 align=center>
457 <div align='center'>all content (c) 2006 Phil Hassey - <a href='http://www.imitationpickles.org/pgu/'>Phil's pyGame Utilities</a></div>
458 </body>
459 </html>

UCC git Repository :: git.ucc.asn.au