0

I'm having trouble with images in turtle graphics. There's a couple things i want the turtle images to do. In some games i would like the images to use the same properties a turtle would have.

how do i give access to turtle commands to an image?

import turtle
turtle.Screen()
#               noticed an image thing here vvvvvv are there more types than ""image""?
img = turtle.addshape("shape", turtle.Shape("image", args))
trtl = turtle.Turtle("shape")

i feel like theres something to do with the "image", seeing that python calls it a shape type

how do i change the transperency of a turtle? i see people talk about RBGA, but that doesnt work on turtle, and i dont think its even a color mode.

import turtle
turtle.Screen()
#create img or turtle.Turtle()
turtle.color(0, 0, 0, opacity) #or something like that

how do i give the images animation? turtle.right and left / size change the size of a turtle, but the images wont show the size on screen. ive seen this happen with PhotoImage, but i dont know how to resize them whenever i want

import turtle
turtle.addshape("img.gif")
turtle.Turtle(img)
turtle.size(6)
#resizes turtle, but image refuses to animate
turtle.right(30)
#turns turtle, but doesnt show it

any help is apreiciated, thank you!

ACMBitz7
  • 14
  • 3
  • maybe use `pillow` to resize and rotate images and later replace images in turtle to get animation and rotation. – furas Feb 19 '22 at 06:46
  • in documentation for [addshape](https://docs.python.org/3.7/library/turtle.html#turtle.addshape) you can see `"Image shapes do not rotate when turning the turtle"` - so you would have to create rotated image and replace them to get rotated turtle. – furas Feb 19 '22 at 07:11
  • thank you, i'll see if i can get pillow to work in turtle graphics – ACMBitz7 Feb 19 '22 at 22:06

0 Answers0