예제 #1
0
 def __init__(self, canvas, frame):
     self.screen = None
     TNavigator.__init__(self)
     TPen.__init__(self)
     canvas.setLineCap(1) # Round
     self.screen = CairoTurtle._Screen(canvas)
     self.frame = frame
     self.__xoff = self.window_width()/2
     self.__yoff = self.window_height()/2
예제 #2
0
 def __init__(self, canvas, frame):
     self._path = None
     self._lines_to_draw = None
     self.screen = None
     TNavigator.__init__(self)
     TPen.__init__(self)
     canvas.setLineCap(1)  # Round
     self.screen = PdfTurtle._Screen(canvas)
     self.frame = frame
     self.__xoff = self.window_width() / 2
     self.__yoff = -self.window_height() / 2
예제 #3
0
 def __init__(self, canvas, frame=None, width=None, height=None):
     self._window_width = width if width is not None else frame._width
     self._window_height = height if height is not None else frame._height
     self._path = None
     self._lines_to_draw = None
     self.screen = None
     TNavigator.__init__(self)
     TPen.__init__(self)
     canvas.setLineCap(1)  # Round
     self.screen = PdfTurtle._Screen(canvas)
     self.__xoff = self.window_width()/2
     self.__yoff = -self.window_height()/2
예제 #4
0
 def __init__(self, drawing, width=None, height=None):
     if width is None:
         width = _parse_int(drawing['width'])
     if height is None:
         height = _parse_int(drawing['height'])
     self._path = None
     self._lines_to_draw = None
     self.screen = None
     TNavigator.__init__(self)
     TPen.__init__(self)
     self.screen = SvgTurtle._Screen(drawing, width, height)
     self.__xoff = self.window_width()/2
     self.__yoff = -self.window_height()/2
예제 #5
0
 def __init__(self, drawing, width=None, height=None):
     if width is None:
         width = _parse_int(drawing['width'])
     if height is None:
         height = _parse_int(drawing['height'])
     self._path = None
     self._lines_to_draw = None
     self.screen = None
     TNavigator.__init__(self)
     TPen.__init__(self)
     self.screen = SvgTurtle._Screen(drawing, width, height)
     self.__xoff = self.window_width() / 2
     self.__yoff = -self.window_height() / 2
예제 #6
0
 def __init__(self, canvas, frame=None, width=None, height=None):
     if width is None:
         width = frame._width
     if height is None:
         height = frame._height
     self._path = None
     self._lines_to_draw = None
     self.screen = None
     TNavigator.__init__(self)
     TPen.__init__(self)
     canvas.setLineCap(1)  # Round
     self.screen = PdfTurtle._Screen(canvas, width, height)
     self.__xoff = self.window_width()/2
     self.__yoff = -self.window_height()/2
예제 #7
0
 def __init__(self, x=0, y=0, heading=0, canvas=None):
     self._path = None
     self._lines_to_draw = []
     TNavigator.__init__(self)
     TPen.__init__(self)
     if canvas == None:
         canvas = Canvas()
     self.screen = MockTurtle._Screen(canvas)
     self.__xoff = self.screen.cv.cget('width')/2
     self.__yoff = self.screen.cv.cget('height')/2
     if x or y:
         self.setx(x)
         self.sety(y)
     self.setheading(heading)
예제 #8
0
 def __init__(self, x=0, y=0, heading=0, canvas=None):
     self._path = None
     self._lines_to_draw = []
     TNavigator.__init__(self)
     TPen.__init__(self)
     if canvas == None:
         canvas = Canvas()
     self.screen = MockTurtle._Screen(canvas)
     self.__xoff = self.screen.cv.cget('width')/2
     self.__yoff = self.screen.cv.cget('height')/2
     if x or y:
         self.setx(x)
         self.sety(y)
     self.setheading(heading)
예제 #9
0
 def __init__(self, x=0, y=0, heading=0, canvas=None):
     self._path = None
     self._lines_to_draw = []
     TNavigator.__init__(self)
     TPen.__init__(self)
     if MockTurtle._screen is not None:
         self.screen = MockTurtle._screen
     else:
         self.screen = MockTurtle._Screen(canvas)
     self.stamps = []
     self.__xoff = self.screen.cv.cget('width')/2
     self.__yoff = self.screen.cv.cget('height')/2
     if x or y:
         self.setx(x)
         self.sety(y)
     self.setheading(heading)
     MockTurtle.instances.append(self)
예제 #10
0
 def __init__(self, drawing, width=None, height=None):
     if width is None:
         width = _parse_int(drawing['width'])
     if height is None:
         height = _parse_int(drawing['height'])
     clip_path = drawing.defs.add(drawing.clipPath(id='border_clip'))
     clip_path.add(drawing.rect(size=(width, height)))
     self._path = None
     self._lines_to_draw = None
     self.screen = None
     TNavigator.__init__(self)
     TPen.__init__(self)
     self.screen = self._Screen(drawing, width, height)
     self.stamps = []
     self.__xoff = self.window_width()/2
     self.__yoff = -self.window_height()/2
     self.color('black', 'black')
예제 #11
0
 def __init__(self, x=0, y=0, heading=0, canvas=None):
     self._path = None
     self._lines_to_draw = []
     TNavigator.__init__(self)
     TPen.__init__(self)
     if MockTurtle._screen is not None:
         self.screen = MockTurtle._screen
     else:
         self.screen = MockTurtle._Screen(canvas)
     self.stamps = []
     self.__xoff = self.screen.cv.cget('width') / 2
     self.__yoff = self.screen.cv.cget('height') / 2
     if x or y:
         self.setx(x)
         self.sety(y)
     self.setheading(heading)
     MockTurtle.instances.append(self)
예제 #12
0
 def reset(self):
     TNavigator.reset(self)
     # noinspection PyUnresolvedReferences,PyProtectedMember
     TPen._reset(self)
     self.screen.cv.report.clear()