@@ -1823,7 +1823,8 @@ Window control
18231823
18241824.. function :: bgpic(picname=None)
18251825
1826- :param picname: a string, name of a gif-file or ``"nopic" ``, or ``None ``
1826+ :param picname: a string, name of an image file (PNG, GIF, PGM, and PPM)
1827+ or ``"nopic" ``, or ``None ``
18271828
18281829 Set background image or return name of current backgroundimage. If *picname *
18291830 is a filename, set the corresponding image as background. If *picname * is
@@ -2200,9 +2201,9 @@ Settings and special methods
22002201.. function :: register_shape(name, shape=None)
22012202 addshape(name, shape=None)
22022203
2203- There are three different ways to call this function:
2204+ There are four different ways to call this function:
22042205
2205- (1) *name * is the name of a gif- file and *shape * is ``None ``: Install the
2206+ (1) *name * is the name of an image file (PNG, GIF, PGM, and PPM) and *shape * is ``None ``: Install the
22062207 corresponding image shape. ::
22072208
22082209 >>> screen.register_shape(" turtle.gif" )
@@ -2211,20 +2212,33 @@ Settings and special methods
22112212 Image shapes *do not * rotate when turning the turtle, so they do not
22122213 display the heading of the turtle!
22132214
2214- (2) *name * is an arbitrary string and *shape * is a tuple of pairs of
2215+ (2) *name * is an arbitrary string and *shape * is the name of an image file (PNG, GIF, PGM, and PPM): Install the
2216+ corresponding image shape. ::
2217+
2218+ >>> screen.register_shape(" turtle" , " turtle.gif" )
2219+
2220+ .. note ::
2221+ Image shapes *do not * rotate when turning the turtle, so they do not
2222+ display the heading of the turtle!
2223+
2224+ (3) *name * is an arbitrary string and *shape * is a tuple of pairs of
22152225 coordinates: Install the corresponding polygon shape.
22162226
22172227 .. doctest ::
22182228 :skipif: _tkinter is None
22192229
22202230 >>> screen.register_shape(" triangle" , ((5 ,- 3 ), (0 ,5 ), (- 5 ,- 3 )))
22212231
2222- (3 ) *name * is an arbitrary string and *shape * is a (compound) :class: `Shape `
2232+ (4 ) *name * is an arbitrary string and *shape * is a (compound) :class: `Shape `
22232233 object: Install the corresponding compound shape.
22242234
22252235 Add a turtle shape to TurtleScreen's shapelist. Only thusly registered
22262236 shapes can be used by issuing the command ``shape(shapename) ``.
22272237
2238+ .. versionchanged :: next
2239+ Added support for PNG, PGM, and PPM image formats.
2240+ Both a shape name and an image file name can be specified.
2241+
22282242
22292243.. function :: turtles()
22302244
0 commit comments