コード例 #1
0
ファイル: bezier.py プロジェクト: aoloe/shoebot
    def __init__(self, bot, path=None, fill=None, stroke=None, strokewidth=None, pathmode=CORNER, packed_elements=None):
        # Stores two lists, _elements and _render_funcs that are kept syncronized
        # _render_funcs contain functions that do the rendering
        # _elements contains either a PathElement or the arguments that need
        # to be passed to a PathElement when it's created.
        #
        # This way PathElements are not created unless they are used in the bot
        Grob.__init__(self, bot)

        if packed_elements is not None:
            self._elements, self._render_funcs = packed_elements
        else:
            self._elements = []
            self._render_funcs = []

        self._fillcolor = fill
        self._strokecolor = stroke
        self._strokewidth = strokewidth
        self._pathmode = pathmode
        self.closed = False

        self._drawn = False
        self._bounds = None
        self._center = None
        self._segments = None

        if isinstance(path, (tuple,list)):
            # list of path elements
            for element in path:
                self.append(element)
        elif isinstance(path, BezierPath):
            self._elements = list(path._elements)
            self._render_funcs = list(path._render_funcs)
            self.closed = path.closed
コード例 #2
0
    def __init__(self, bot, path=None, fill=None, stroke=None, strokewidth=None, pathmode=CORNER, packed_elements=None):
        # Stores two lists, _elements and _render_funcs that are kept syncronized
        # _render_funcs contain functions that do the rendering
        # _elements contains either a PathElement or the arguments that need
        # to be passed to a PathElement when it's created.
        #
        # This way PathElements are not created unless they are used in the bot
        Grob.__init__(self, bot)
        ColorMixin.__init__(self, fill=fill, stroke=stroke, strokewidth=strokewidth)

        if packed_elements is not None:
            self._elements, self._render_funcs = packed_elements
        else:
            self._elements = []
            self._render_funcs = []

        self._pathmode = pathmode
        self.closed = False

        self._drawn = False
        self._bounds = None
        self._center = None
        self._segments = None

        if isinstance(path, (tuple,list)):
            # list of path elements
            for element in path:
                self.append(element)
        elif isinstance(path, BezierPath):
            self._elements = list(path._elements)
            self._render_funcs = list(path._render_funcs)
            self.closed = path.closed
コード例 #3
0
ファイル: bezier.py プロジェクト: aoloe/shoebot
 def __init__(self, bot, **kwargs):
     Grob.__init__(self, bot)
コード例 #4
0
 def __init__(self, bot, **kwargs):
     Grob.__init__(self, bot)