~ubuntu-branches/ubuntu/gutsy/pygame/gutsy

« back to all changes in this revision

Viewing changes to docs/ref/pygame_transform.html

  • Committer: Bazaar Package Importer
  • Author(s): Ed Boraas
  • Date: 2002-02-20 06:39:24 UTC
  • Revision ID: james.westby@ubuntu.com-20020220063924-amlzj7tqkeods4eq
Tags: upstream-1.4
ImportĀ upstreamĀ versionĀ 1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<title>pygame.transform</title>
 
3
<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
 
4
 
 
5
 
 
6
<table cellspacing=3 width=100%><tr><td bgcolor=#00000>
 
7
<table width=100%><tr><td bgcolor=c2fc20 align=center>
 
8
    <a href=http://www.pygame.org>
 
9
    <img src=../pygame_tiny.gif border=0 width=200 height=60></a><br>
 
10
    <b>pygame&nbsp;&nbsp;&nbsp;documentation</b>
 
11
</td><td bgcolor=6aee28 align=center valign=top width=100%>
 
12
 
 
13
        ||&nbsp;
 
14
        <a href=http://www.pygame.org>Home</a> &nbsp;||&nbsp;
 
15
        <a href=../index.html>Help Contents</a> &nbsp;||
 
16
        <br>&nbsp;<br>
 
17
 
 
18
|| <a href=pygame.html>pygame</a> || 
 
19
<a href=pygame_cdrom.html>cdrom</a> || 
 
20
<a href=pygame_constants.html>constants</a> || 
 
21
<a href=pygame_display.html>display</a> || 
 
22
<a href=pygame_draw.html>draw</a> || 
 
23
<a href=pygame_event.html>event</a> ||<br>
 
24
|| <a href=pygame_font.html>font</a> || 
 
25
<a href=pygame_image.html>image</a> || 
 
26
<a href=pygame_joystick.html>joystick</a> || 
 
27
<a href=pygame_key.html>key</a> || 
 
28
<a href=pygame_mixer.html>mixer</a> || 
 
29
<a href=pygame_mixer_music.html>mixer_music</a> ||<br>
 
30
|| <a href=pygame_mouse.html>mouse</a> || 
 
31
<a href=pygame_movie.html>movie</a> || 
 
32
<a href=pygame_surfarray.html>surfarray</a> || 
 
33
<a href=pygame_time.html>time</a> || 
 
34
<a href=pygame_transform.html>transform</a> ||<br>
 
35
&nbsp;<br>|| <a href=CD.html>CD</a> || 
 
36
<a href=Channel.html>Channel</a> || 
 
37
<a href=Clock.html>Clock</a> || 
 
38
<a href=Font.html>Font</a> || 
 
39
<a href=Joystick.html>Joystick</a> || 
 
40
<a href=Movie.html>Movie</a> ||<br>
 
41
|| <a href=Rect.html>Rect</a> || 
 
42
<a href=Sound.html>Sound</a> || 
 
43
<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>
 
47
 
 
48
 
 
49
</td></tr></table></td></tr></table>
 
50
<br>
 
51
<h2 align=center>pygame.transform</h2>
 
52
Contains routines to transform a Surface image.
 
53
<br>&nbsp;<br>
 
54
All transformation functions take a source Surface and
 
55
return a new copy of that surface in the same format as
 
56
the original.
 
57
<br>&nbsp;<br>
 
58
Some of the
 
59
filters are 'destructive', which means if you transform
 
60
the image one way, you can't transform the image back to
 
61
the exact same way as it was before. If you plan on doing
 
62
many transforms, it is good practice to keep the original
 
63
untransformed image, and only translate that image.
 
64
 
 
65
<hr>
 
66
 
 
67
<table>
 
68
<tr><td><a href=#flip>flip</a></td><td> -
 
69
flips a surface on either axis</td></tr>
 
70
 
 
71
 
 
72
<tr><td><a href=#rotate>rotate</a></td><td> -
 
73
rotate a Surface</td></tr>
 
74
 
 
75
 
 
76
<tr><td><a href=#rotozoom>rotozoom</a></td><td> -
 
77
smoothly scale and/or rotate an image</td></tr>
 
78
 
 
79
 
 
80
<tr><td><a href=#scale>scale</a></td><td> -
 
81
scale a Surface to an arbitrary size</td></tr>
 
82
 
 
83
 
 
84
</table>
 
85
 
 
86
<hr>
 
87
 
 
88
<a name=flip><font size=+2><b>flip
 
89
</b></font><br><font size=+1><tt>
 
90
pygame.transform.flip(Surface, xaxis, yaxis) -> Surface
 
91
</tt></font><ul>
 
92
Flips the image on the x-axis or the y-axis if the argument
 
93
for that axis is true.
 
94
<br>&nbsp;<br>
 
95
The flip operation is nondestructive, you may flip the image
 
96
as many times as you like, and always be able to recreate the
 
97
exact original image.
 
98
</ul><br>&nbsp;<br>
 
99
 
 
100
<a name=rotate><font size=+2><b>rotate
 
101
</b></font><br><font size=+1><tt>
 
102
pygame.transform.rotate(Surface, angle) -> Surface
 
103
</tt></font><ul>
 
104
Rotates the image counterclockwise with the given angle
 
105
(in degrees). The angle can be any floating point value
 
106
(negative rotation amounts will do clockwise rotations)
 
107
<br>&nbsp;<br>
 
108
Unless rotating by 90 degree increments, the resulting image
 
109
size will be larger than the original. There will be newly
 
110
uncovered areas in the image. These will filled with either
 
111
the current colorkey for the Surface, or the topleft pixel value.
 
112
(with the alpha channel zeroed out if available)
 
113
<br>&nbsp;<br>
 
114
This transformation is not filtered.
 
115
</ul><br>&nbsp;<br>
 
116
 
 
117
<a name=rotozoom><font size=+2><b>rotozoom
 
118
</b></font><br><font size=+1><tt>
 
119
pygame.transform.rotozoom(Surface, angle, zoom) -> Surface
 
120
</tt></font><ul>
 
121
The angle argument is the number of degrees to rotate
 
122
counter-clockwise. The angle can be any floating point value.
 
123
(negative rotation amounts will do clockwise rotations)
 
124
<br>&nbsp;<br>
 
125
This will smoothly rotate and scale an image in one pass.
 
126
The resulting image will always be a 32bit version of the
 
127
original surface. The scale is a multiplier for the image
 
128
size, and angle is the degrees to rotate counter clockwise.
 
129
<br>&nbsp;<br>
 
130
It calls the SDL_rotozoom library which is compiled in.
 
131
Note that the code in SDL_rotozoom is fairly messy and your
 
132
resulting image could be shifted and contain artifacts.
 
133
</ul><br>&nbsp;<br>
 
134
 
 
135
<a name=scale><font size=+2><b>scale
 
136
</b></font><br><font size=+1><tt>
 
137
pygame.transform.scale(Surface, size) -> Surface
 
138
</tt></font><ul>
 
139
This will resize a surface to the given resolution.
 
140
The size is simply any 2 number sequence representing
 
141
the width and height.
 
142
<br>&nbsp;<br>
 
143
This transformation is not filtered.
 
144
</ul><br>&nbsp;<br>
 
145
 
 
146
 
 
147
<hr>
 
148
</body></html>