Home | History | Annotate | Download | only in lib-tk

Lines Matching defs:Shape

119                'RawTurtle', 'Turtle', 'RawPen', 'Pen', 'Shape', 'Vec2D']
135 'setundobuffer', 'setx', 'sety', 'shape', 'shapesize', 'showturtle',
161 "shape": "classic",
825 class Shape(object):
845 raise TurtleGraphicsError("There is no shape type %s" % type_)
849 """Add component to a shape of type compound.
860 >>> s = Shape("compound")
865 raise TurtleGraphicsError("Cannot add component to %s Shape"
923 "arrow" : Shape("polygon", ((-10,0), (10,0), (0,10))),
924 "turtle" : Shape("polygon", ((0,16), (-2,14), (-1,10), (-4,7),
929 "circle" : Shape("polygon", ((10,0), (9.51,3.09), (8.09,5.88),
935 "square" : Shape("polygon", ((10,-10), (10,10), (-10,10),
937 "triangle" : Shape("polygon", ((10,-5.77), (0,11.55),
939 "classic": Shape("polygon", ((0,0),(-5,-9),(0,-7),(5,-9))),
940 "blank" : Shape("image", self._blankimage())
1053 def register_shape(self, name, shape=None):
1054 """Adds a turtle shape to TurtleScreen's shapelist.
1057 (1) name is the name of a gif-file and shape is None.
1058 Installs the corresponding image shape.
1061 (2) name is an arbitrary string and shape is a tuple
1063 polygon shape
1064 (3) name is an arbitrary string and shape is a
1065 (compound) Shape object. Installs the corresponding
1066 compound shape.
1067 To use a shape, you have to issue the command shape(shapename).
1076 if shape is None:
1079 shape = Shape("image", self._image(name))
1083 elif isinstance(shape, tuple):
1084 shape = Shape("polygon", shape)
1085 ## else shape assumed to be Shape-instance
1086 self._shapes[name] = shape
1087 # print "shape added:" , self._shapes
2424 shape=_CFG["shape"],
2449 self.turtle = _TurtleImage(screen, shape)
2657 def shape(self, name=None):
2658 """Set turtle shape to shape with given name / return current shapename.
2663 Set turtle shape to shape with given name or, if name is not given,
2664 return name of current shape.
2665 Shape with name must exist in the TurtleScreen's shape dictionary.
2671 >>> turtle.shape()
2673 >>> turtle.shape("turtle")
2674 >>> turtle.shape()
2680 raise TurtleGraphicsError("There is no shape named %s" % name)
2734 >>> turtle.shape("circle")
2757 >>> turtle.shape("circle")
2775 >>> turtle.shape("circle")
2785 """Computes transformed polygon shapes from a shape
2798 its shape, resizemode, stretch and tilt etc."""
2800 shape = screen._shapes[self.turtle.shapeIndex]
2801 ttype = shape._type
2805 tshape = shape._data
2809 shape = tshape
2819 shape = [(lx*x, ly*y) for (x, y) in tshape]
2821 shape = [(t1*x+t0*y, -t0*x+t1*y) for (x, y) in shape]
2822 shape = self._polytrafo(shape)
2824 screen._drawpoly(titem, shape, fill=fc, outline=oc,
2856 Stamp a copy of the turtle shape onto the canvas at the current
2867 shape = screen._shapes[self.turtle.shapeIndex]
2868 ttype = shape._type
2869 tshape = shape._data
2874 shape = tshape
2884 shape = [(lx*x, ly*y) for (x, y) in tshape]
2886 shape = [(t1*x+t0*y, -t0*x+t1*y) for (x, y) in shape]
2887 shape = self._polytrafo(shape)
2889 screen._drawpoly(stitem, shape, fill=fc, outline=oc,
3129 """Call fill(True) before drawing a shape to fill, fill(False) when done.
3134 Call fill(True) before drawing the shape you want to fill,
3180 """Called just before drawing a shape to be filled.
3198 """Fill the shape drawn after the call begin_fill().
3699 shape=_CFG["shape"],
3705 shape=shape,
3986 shape("turtle")
3992 turtle.shape("turtle")