Esempio n. 1
0
    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
        )
Esempio n. 2
0
    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
        )
Esempio n. 3
0
    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),
        )
Esempio n. 4
0
    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),
        )
Esempio n. 5
0
    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),
        )
Esempio n. 6
0
    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)
Esempio n. 7
0
    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)
Esempio n. 8
0
    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)
Esempio n. 9
0
    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
        )
Esempio n. 10
0
 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)
Esempio n. 11
0
 def clean_up(self):
     AnimationGroup.clean_up(self)
     self.pi_creature.bubble = None
Esempio n. 12
0
 def creation_anim(self, desc_anim = FadeIn, brace_anim = GrowFromCenter):
     return AnimationGroup(brace_anim(self.brace), desc_anim(self.desc))
Esempio n. 13
0
 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)
Esempio n. 14
0
 def creation_anim(self, label_anim=FadeIn, brace_anim=GrowFromCenter):
     return AnimationGroup(brace_anim(self.brace), label_anim(self.label))