def __init__(self, draw=Draw()): self.draw = draw self.screen = self.draw.window.screen self.open = self.draw.window.open self.check = self.draw.window.check self.clear = self.draw.clear self.flip = self.draw.window.flip
def __init__(self, draw=None, console=None, camera=None, **kwargs): """Create a context using the optional draw, console and camera, with some of the draw's arguments for the window. If those are not given, they will be created automatically.""" if draw is None: draw = Draw(**kwargs) if console is None: console = Console(draw) if camera is None: camera = Camera(draw) self.start_time = tm.time() self.draw = draw self.console = console self.camera = camera self.clear = self.draw.clear self.flip = self.draw.window.flip self.press = self.draw.window.press self.build = self.draw.window.build self.click = self.draw.window.click self.__call__ = self.draw.window.__call__ self.wait = self.draw.window.wait self.control = self.draw.control self.checking = self.draw.window.checking self.loadImage = self.draw.window.loadImage self.print = self.draw.print self.update = self.draw.window.update self.switch = self.draw.window.switch self.count = self.draw.window.count self.alert = self.draw.window.alert self.scale = self.draw.window.scale
def __init__(self, draw=None, **kwargs): """Create a surface.""" if not draw: self.draw = Draw(**kwargs) else: self.draw = draw self.screen = self.draw.window.screen self.open = self.draw.window.open self.clear = self.draw.clear self.flip = self.draw.window.flip self.press = self.draw.window.press self.build = self.draw.window.build self.__call__ = self.draw.window.__call__ #self.show=self.draw.show self.control = self.draw.control
def __init__(self,draw=None,console=None,**kwargs): """Create a context.""" if draw is None: self.draw=Draw(**kwargs) else: self.draw=draw if console is None: self.console=Console(self.draw) self.screen=self.draw.window.screen #self.open=self.draw.window.open self.clear=self.draw.clear self.flip=self.draw.window.flip self.press=self.draw.window.press self.build=self.draw.window.build self.click=self.draw.window.click self.__call__=self.draw.window.__call__ self.wait=self.draw.window.wait self.control=self.draw.control self.events=self.draw.window.events self.checking=self.draw.window.checking self.loadImage=self.draw.window.loadImage self.print=self.draw.print
from mywindow import Window from mysurface import Surface from mydraw import Draw from math import sqrt, atan, pi, cos, sin, pi from cmath import polar from mycolors import * from myabstract import Point, Form, Vector import random import time if __name__ == "__main__": real_window = Window(size=[1440, 900], fullscreen=True) draw = Draw(window=real_window) window = Surface( draw) #Create not a real window but a surface to display on screen. #window=Window(fullscreen=True) p1 = Point(1, -6) p2 = Point(-2, 4) p3 = Point(8, 5) p4 = Point(4, 4, color=(0, 255, 0)) points = [p1, p3, p2, p4] f = Form([ Point(random.randint(-10, 10), random.randint(-10, 10)) for i in range(10) ]) #f.show(window) f2 = f.getSparse() p1.show(window)
def __init__(self, draw=Draw()): Window.__init__(self) self.draw = draw
def __init__(self, *args, **kwargs): Window.__init__(self, *args, **kwargs) self.draw = Draw()
from myform import Form #from mywindow import Window from mydraw import Draw if __name__=="__main__": draw=Draw() draw