How to use the pyno.draw.Line function in pyno

To help you get started, we’ve selected a few pyno examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github honix / Pyno / pyno / window.py View on Github external
def new_batch(self):
        self.batch = pyglet.graphics.Batch()
        self.info_label = pyglet.text.Label('BOOM!!', font_name=font,
                                            font_size=9, batch=self.batch,
                                            color=(200, 200, 255, 100),
                                            x=160, y=10, group=draw.uiGroup)
        # load pyno-logo in left bottom
        corner = pkg_resources.resource_stream('pyno', 'imgs/corner.png')
        pyno_logo_img = pyglet.image.load('dummyname', file=corner)
        self.pyno_logo = pyglet.sprite.Sprite(pyno_logo_img,
                                              batch=self.batch,
                                              group=draw.uiGroup)
        self.menu = menu.Menu(self)
        # line place-holder
        self.line = (draw.Line(self.batch), draw.Line(self.batch))
github honix / Pyno / pyno / element.py View on Github external
self.put_size, self.put_size, c)

        for output in self.put_pos(self.outputs):
            put_name = self.selectedOutput['name']
            if output['name'] == put_name:
                c = color_inverse(self.pin_color)
            else:
                c = self.pin_color
            gr['outputs'][output['name']].redraw(
                    output['pos'],
                    self.y - self.ch - self.put_size,
                    self.put_size, self.put_size, c)

        con = gr['connections']
        while len(con) < len(self.connected_to):
            con.append([Line(self.batch), Line(self.batch), Line(self.batch)])

        i = -1
        for node in self.connected_to:
            i += 1
            n = node['output']['node']

            try:
                iputx = self.put_pos_by_name(node['input']['put']['name'],
                                             'inputs')
                oputx = n.put_pos_by_name(node['output']['put']['name'],
                                          'outputs')
                if not iputx or not oputx:
                    raise Exception()
            except Exception as ex:
                for lines in con[i]:
                    lines.delete()