How to use the pyno.element.Element 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 / element.py View on Github external
def __init__(self, x, y, color, batch, id):
        if id:
            self.id_counter = max(self.id_counter, id)
            self.id = self.id_counter
        else:
            Element.id_counter += 1
            self.id = self.id_counter

        self.x, self.y = x, y
        self.w, self.h = 70, 30
        self.cw, self.ch = self.w // 2, self.h // 2
        self.offset = 20
        self.put_size = 5
        self.pin_color = color_select(color)
        self.color = color
        self.draw_color = color
        self.er_color = (230, 20, 20)

        self.active = True
        self.batch = batch
        self.graphics = dict(inputs=dict(), outputs=dict(), connections=list(),
                             error=None, base=Quad(self.batch))
github honix / Pyno / pyno / field.py View on Github external
import pyglet
import pyperclip

from pyno.element import Element
from pyno.utils import x_y_pan_scale, font
from pyno.draw import Quad, labelsGroup


class Field(Element):
    '''
    Field is a white box where you can put values
    '''

    def __init__(self, window, x, y, batch, code='0', connects=None, size=None, id=None):
        Element.__init__(self, x, y, (230, 230, 230), batch, id)

        if size:
            self.w, self.h = size

        if connects:
            self.connected_to = connects

        self.window = window
        self.code = code