예제 #1
0
    def on_pos(self, *args):
        del args

        with self.canvas:
            Color(*self.config['color'])
            KivyPoint(points=self.config['points'],
                      pointsize=self.config['pointsize'])
예제 #2
0
    def __init__(self,
                 points=None,
                 pointsize=1.,
                 color=None,
                 alpha=1.,
                 **kwargs):
        super().__init__(**kwargs)

        self._color = KivyColor(rgb=color or OFFWHITE, a=alpha)
        self._shape = KivyPoint(
            points=points,
            pointsize=pointsize,
        )

        self.add(self._color)
        self.add(self._shape)
예제 #3
0
파일: point.py 프로젝트: idannik/mpf-mc
    def _draw_widget(self, *args) -> None:
        """Establish the drawing instructions for the widget."""
        del args

        if self.canvas is None:
            return

        # TODO: allow user to set rotation/scale origin
        center = center_of_points_list(self.points)
        self.canvas.clear()

        with self.canvas:
            Color(*self.color)
            Scale(self.scale, origin=center)
            Rotate(angle=self.rotation, origin=center)
            KivyPoint(points=self.points, pointsize=self.pointsize)