A community-maintained Python framework for creating mathematical animations.
Changed mobject of ScreenTracker
Grant Sandersonc2b3e3f3e03e
diff --git a/topics/light.py b/topics/light.pyindex 4de886b2e..23721ef1d 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_opacityself.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()++++++++++++++++