l = [] for i in range(self.used): a = pi * 2 / self.used * i + self.angle if (i % self.dent_ratio < self.dent_ratio / 2): r = self.inner_radius else: r = self.outer_radius l.append((cos(a) * r, sin(a) * r)) return l e = Eel(vsync=False) @e.draw def render(eel): fps = eel.fps or 60 x, y = eel.mouse g = fig.drawGear(x, y, 40, 55, target=eel) g.angle += 0.01 / fps * 60 fig.drawCircle(x, y, 20, target=eel) e.run()
# NOTE: This weird import down here only looks this way because the module # is located at the root . directory, while this file is at ./examples. # Usually you would simply use `from eel import Eel`, with none of that # Down there. ATTEMPTS = 4 for i in range(ATTEMPTS): try: from eelengine import Eel from eelengine.figure import Circle, Text, Line, Rectangle, Font break except ModuleNotFoundError: path.insert(0, '..') window = Eel(vsync=False) c = Rectangle(0, 0, width=40, height=40) w, h = window.dimensions d = Circle(w/2, h/2, radius=60, fill=True) d.setColor(80, 170, 80, 255) global t t = None xp, yp = d.collisionCenter() l = Line(c.x, c.y, xp=xp, yp=yp) r = Rectangle(c.x, c.y, width=c.x-xp, height=c.y-yp) @window.load def loadFont(eel):