def __init__(self, pi_creature, *content, **kwargs): digest_config(self, kwargs) bubble = pi_creature.get_bubble("speech") bubble.write(*content) bubble.resize_to_content() bubble.pin_to(pi_creature) pi_creature.bubble = bubble AnimationGroup.__init__( self, ApplyMethod( pi_creature.change_mode, self.target_mode, **self.change_mode_kwargs ), ShowCreation( bubble, **self.bubble_creation_kwargs ), Write( bubble.content, **self.write_kwargs ), **kwargs )
def __init__(self, pi_creature, *content, **kwargs): digest_config(self, kwargs) bubble = pi_creature.get_bubble( *content, bubble_class = self.bubble_class, **self.bubble_kwargs ) Group(bubble, bubble.content).shift_onto_screen() pi_creature.generate_target() pi_creature.target.change_mode(self.target_mode) if self.look_at_arg is not None: pi_creature.target.look_at(self.look_at_arg) change_mode = MoveToTarget(pi_creature, **self.change_mode_kwargs) bubble_creation = self.bubble_creation_class( bubble, **self.bubble_creation_kwargs ) content_introduction = self.content_introduction_class( bubble.content, **self.content_introduction_kwargs ) AnimationGroup.__init__( self, change_mode, bubble_creation, content_introduction, **kwargs )
def __init__(self, pi_creature, **kwargs): assert hasattr(pi_creature, "bubble") digest_config(self, kwargs, locals()) AnimationGroup.__init__( self, ApplyMethod(pi_creature.change_mode, self.target_mode), FadeOut(pi_creature.bubble), FadeOut(pi_creature.bubble.content), )
def __init__(self, pi_creature, **kwargs): assert hasattr(pi_creature, "bubble") digest_config(self, kwargs, locals()) pi_creature.generate_target() pi_creature.target.change_mode(self.target_mode) if self.look_at_arg is not None: pi_creature.target.look_at(self.look_at_arg) AnimationGroup.__init__( self, MoveToTarget(pi_creature), FadeOut(pi_creature.bubble), FadeOut(pi_creature.bubble.content), )
def __init__(self, pi_creature, *content, **kwargs): digest_config(self, kwargs) bubble = pi_creature.get_bubble("speech", **self.bubble_kwargs) bubble.write(*content) bubble.resize_to_content() bubble.pin_to(pi_creature) pi_creature.bubble = bubble pi_creature.generate_target() pi_creature.target.change_mode(self.target_mode) if self.look_at_arg: pi_creature.target.look_at(self.look_at_arg) AnimationGroup.__init__( self, MoveToTarget(pi_creature, **self.change_mode_kwargs), ShowCreation(bubble, **self.bubble_creation_kwargs), Write(bubble.content, **self.write_kwargs), **kwargs)
def __init__(self, pi_creature, *content, **kwargs): digest_config(self, kwargs) bubble = pi_creature.get_bubble(*content, bubble_class=self.bubble_class, **self.bubble_kwargs) pi_creature.generate_target() pi_creature.target.change_mode(self.target_mode) if self.look_at_arg is not None: pi_creature.target.look_at(self.look_at_arg) change_mode = MoveToTarget(pi_creature, **self.change_mode_kwargs) bubble_creation = self.bubble_creation_class( bubble, **self.bubble_creation_kwargs) writing = Write(bubble.content, **self.write_kwargs) AnimationGroup.__init__(self, change_mode, bubble_creation, writing, **kwargs)
def __init__(self, pi_creature, *content, **kwargs): digest_config(self, kwargs) if isinstance(content, Mobject): bubble_content = content else: bubble_content = TextMobject(*content) bubble = pi_creature.get_bubble(self.bubble_class, content=bubble_content, **self.bubble_kwargs) pi_creature.generate_target() pi_creature.target.change_mode(self.target_mode) if self.look_at_arg: pi_creature.target.look_at(self.look_at_arg) AnimationGroup.__init__( self, MoveToTarget(pi_creature, **self.change_mode_kwargs), ShowCreation(bubble, **self.bubble_creation_kwargs), Write(bubble.content, **self.write_kwargs), **kwargs)
def __init__(self, pi_creature, *content, **kwargs): digest_config(self, kwargs) bubble = pi_creature.get_bubble( *content, bubble_class = self.bubble_class, **self.bubble_kwargs ) pi_creature.generate_target() pi_creature.target.change_mode(self.target_mode) if self.look_at_arg is not None: pi_creature.target.look_at(self.look_at_arg) change_mode = MoveToTarget(pi_creature, **self.change_mode_kwargs) bubble_creation = self.bubble_creation_class( bubble, **self.bubble_creation_kwargs ) writing = Write(bubble.content, **self.write_kwargs) AnimationGroup.__init__( self, change_mode, bubble_creation, writing, **kwargs )
def clean_up(self, surrounding_scene=None): AnimationGroup.clean_up(self, surrounding_scene) self.pi_creature.bubble = None if surrounding_scene is not None: surrounding_scene.add(self.pi_creature)
def clean_up(self): AnimationGroup.clean_up(self) self.pi_creature.bubble = None
def creation_anim(self, desc_anim = FadeIn, brace_anim = GrowFromCenter): return AnimationGroup(brace_anim(self.brace), desc_anim(self.desc))
def clean_up(self, surrounding_scene = None): AnimationGroup.clean_up(self, surrounding_scene) self.pi_creature.bubble = None if surrounding_scene is not None: surrounding_scene.add(self.pi_creature)
def creation_anim(self, label_anim=FadeIn, brace_anim=GrowFromCenter): return AnimationGroup(brace_anim(self.brace), label_anim(self.label))