Ejemplo 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
        )
Ejemplo 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
        )
Ejemplo 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),
        )
Ejemplo 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),
        )
Ejemplo 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),
        )
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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
        )