def __init__(self, gui): super().__init__(gui) rectangle = py.Button(gui, (2, 5), (200, 50), 3, (0, 0, 0), (100, 100, 100), z=100) rectangle.attachText("Rectangle", "Arial Rounded", 30, (0, 0, 0)) rectangle.setLeft(CreateObject, [gui, "rectangle"]) self.buttons.append(rectangle) button = py.Button(gui, (2, 55), (200, 50), 3, (0, 0, 0), (100, 100, 100), z=100) button.attachText("Button", "Arial Rounded", 30, (0, 0, 0)) button.setLeft(CreateObject, [gui, "button"]) self.buttons.append(button) entry = py.Button(gui, (2, 105), (200, 50), 3, (0, 0, 0), (100, 100, 100), z=100) entry.attachText("Entry field", "Arial Rounded", 30, (0, 0, 0)) entry.setLeft(CreateObject, [gui, "entry"]) self.buttons.append(entry) for button in self.buttons: button.setInteractiveColour(False, (150, 150, 150))
def __init__(self, gui): super().__init__(gui) # Name self.name = py.EntryField(gui, (5, -28), (200, 25), 3, (0, 0, 0), (100, 100, 100), z=100, enterClear=False) self.name.offset = (5, -28) self.name.attachBaseText("Name: ", "Arial Rounded", 15, (0, 0, 0)) self.entryFields.append(self.name) # Type self.type = py.Button(gui, (108, -58), (100, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.type.offset = (108, -58) self.type.attachText("", "Arial Rounded", 15, (0, 0, 0)) self.buttons.append(self.type) # Delete self.delete = py.Button(gui, (5, -58), (100, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.delete.offset = (5, -58) self.delete.setInteractiveColour(False, (150, 150, 150)) self.delete.setLeft(gui.deleteSelected, None) self.delete.attachText("delete", "Arial Rounded", 15, (0, 0, 0)) self.buttons.append(self.delete) for entry in self.entryFields: entry.setHoverColour(False, (150, 150, 150)) entry.setSelectedColour(False, (130, 130, 130))
def __init__(self, gui): super().__init__(gui) # Size info self.info = py.Button(gui, (0, 0), (223, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.info.offset = self.info.position self.info.attachText("Current window size:", "Arial Rounded", 15, (0, 0, 0)) self.buttons.append(self.info) self.currentX = py.Button(gui, (0, 30), (110, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.currentX.offset = self.currentX.position self.currentX.attachText("Width: ", "Arial Rounded", 15, (0, 0, 0)) self.buttons.append(self.currentX) self.currentY = py.Button(gui, (113, 30), (110, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.currentY.offset = self.currentY.position self.currentY.attachText("Width: ", "Arial Rounded", 15, (0, 0, 0)) self.buttons.append(self.currentY) self.other = py.Button(gui, (0, 60), (223, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.other.offset = self.other.position self.other.attachText("Your new render window size:", "Arial Rounded", 15, (0, 0, 0)) self.buttons.append(self.other) # size self.sizeX = py.EntryField(gui, (0, 90), (110, 25), 3, (0, 0, 0), (100, 100, 100), z=100, characterCap=5, enterClear=False) self.sizeX.setFilter(numbers=True) self.sizeX.offset = self.sizeX.position self.sizeX.attachBaseText("Width: ", "Arial Rounded", 15, (0, 0, 0)) self.entryFields.append(self.sizeX) self.sizeY = py.EntryField(gui, (113, 90), (110, 25), 3, (0, 0, 0), (100, 100, 100), z=100, characterCap=5, enterClear=False) self.sizeY.setFilter(numbers=True) self.sizeY.offset = self.sizeY.position self.sizeY.attachBaseText("Height: ", "Arial Rounded", 15, (0, 0, 0)) self.entryFields.append(self.sizeY) for entry in self.entryFields: entry.setHoverColour(False, (150, 150, 150)) entry.setSelectedColour(False, (130, 130, 130))
def __init__(self, gui): super().__init__(gui) self.highlightObj = False self.highlight = py.Button(gui, (103, 93), (100, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.highlight.offset = (63, 93) self.highlight.attachText("Highlight", "Arial Rounded", 15, (0, 0, 0)) self.highlight.setLeft(self.SwapHighlight, None) self.buttons.append(self.highlight) for button in self.buttons: button.setInteractiveColour(False, (150, 150, 150))
def __init__(self, gui): super().__init__(gui) self.compile = py.Button(gui, (0, 120), (100, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.compile.offset = self.compile.position self.compile.attachText("Compile", "Arial Rounded", 15, (0, 0, 0)) self.compile.setLeft(gui.compile, None) self.buttons.append(self.compile) for button in self.buttons: button.setInteractiveColour(False, (150, 150, 150))
def __init__(self, gui): super().__init__(gui) self.backgroundColour = False # Outline colour self.colR = py.EntryField(gui, (5, 63), (53, 25), 3, (255, 0, 0), (100, 100, 100), z=100, characterCap=3, enterClear=False) self.colR.setFilter(numbers=True) self.colR.offset = (5, 63) self.colR.attachBaseText("R: ", "Arial Rounded", 15, (0, 0, 0)) self.entryFields.append(self.colR) self.colG = py.EntryField(gui, (61, 63), (53, 25), 3, (0, 255, 0), (100, 100, 100), z=100, characterCap=3, enterClear=False) self.colG.setFilter(numbers=True) self.colG.offset = (61, 63) self.colG.attachBaseText("G: ", "Arial Rounded", 15, (0, 0, 0)) self.entryFields.append(self.colG) self.colB = py.EntryField(gui, (117, 63), (53, 25), 3, (0, 0, 255), (100, 100, 100), z=100, characterCap=3, enterClear=False) self.colB.setFilter(numbers=True) self.colB.offset = (117, 63) self.colB.attachBaseText("B: ", "Arial Rounded", 15, (0, 0, 0)) self.entryFields.append(self.colB) # Background colour button self.bcButton = py.Button(gui, (175, 63), (25, 25), 3, (0, 0, 0), (255, 255, 255), z=100) self.bcButton.offset = (175, 63) self.bcButton.setLeft(self.switchBCStatus, None) self.buttons.append(self.bcButton) for button in self.buttons: button.setInteractiveColour(False, (150, 150, 150)) for entry in self.entryFields: entry.setHoverColour(False, (150, 150, 150)) entry.setSelectedColour(False, (130, 130, 130))
def __init__(self, gui): super().__init__(gui) self.offset = (0, 123) self.toggle = False self.toggleButton = py.Button(gui, (5, 123), (100, 25), 3, (0, 0, 0), (100, 100, 100), z=100) self.toggleButton.offset = (5, 123) self.toggleButton.attachText("Text", "Arial Rounded", 15, (0, 0, 0)) self.toggleButton.setLeft(self.swap, None) self.buttons.append(self.toggleButton) for button in self.buttons: button.setInteractiveColour(False, (150, 150, 150))