From c2b3e3f3e03eccd12d4c9a4a0ef1aa23f5a3b22e Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Mon, 26 Feb 2018 23:34:42 -0800 Subject: [PATCH] Changed mobject of ScreenTracker --- topics/light.py | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/topics/light.py b/topics/light.py index 4de886b2..23721ef1 100644 --- a/topics/light.py +++ b/topics/light.py @@ -314,8 +314,9 @@ class SwitchOn(LaggedStart): def __init__(self, light, **kwargs): if (not isinstance(light,AmbientLight) and not isinstance(light,Spotlight)): raise Exception("Only AmbientLights and Spotlights can be switched on") - LaggedStart.__init__(self, - FadeIn, light, **kwargs) + LaggedStart.__init__( + self, FadeIn, light, **kwargs + ) class SwitchOff(LaggedStart): @@ -333,8 +334,6 @@ class SwitchOff(LaggedStart): light.submobjects = light.submobjects[::-1] - - class Lighthouse(SVGMobject): CONFIG = { "file_name" : "lighthouse", @@ -344,7 +343,6 @@ class Lighthouse(SVGMobject): def move_to(self,point): self.next_to(point, DOWN, buff = 0) - class AmbientLight(VMobject): # Parameters are: @@ -421,19 +419,6 @@ class AmbientLight(VMobject): submob.set_fill(opacity = new_submob_alpha) - - - - - - - - - - - - - class Spotlight(VMobject): CONFIG = { @@ -590,7 +575,6 @@ class Spotlight(VMobject): - def dimming(self,new_alpha): old_alpha = self.max_opacity self.max_opacity = new_alpha @@ -623,7 +607,27 @@ class Spotlight(VMobject): class ScreenTracker(ContinualAnimation): + def __init__(self, light_source, **kwargs): + self.light_source = light_source + dummy_mob = Mobject() + ContinualAnimation.__init__(self, dummy_mob, **kwargs) def update_mobject(self, dt): - self.mobject.update() + self.light_source.update() + + + + + + + + + + + + + + + +