示例#1
0
    def construct(self):
        mathy, bubble = get_mathy_and_bubble()
        bubble.stretch_to_fit_width(4)
        mathy.to_corner(DOWN+LEFT)
        bubble.pin_to(mathy)
        bubble.shift(LEFT)
        morty = Mortimer()
        morty.to_corner(DOWN+RIGHT)
        morty_bubble = SpeechBubble()
        morty_bubble.stretch_to_fit_width(4)
        morty_bubble.pin_to(morty)
        bubble.write("""
            Did you know a curve \\\\
            can fill all space?
        """)
        morty_bubble.write("Who cares?")

        self.add(mathy, morty)
        for bub, buddy in [(bubble, mathy), (morty_bubble, morty)]:
            self.play(Transform(
                Point(bub.get_tip()),
                bub
            ))
            self.play(ShimmerIn(bub.content))
            self.play(ApplyMethod(
                buddy.blink,
                rate_func = squish_rate_func(there_and_back)
            ))
示例#2
0
    def construct(self):
        mathy, bubble = get_mathy_and_bubble()
        bubble.stretch_to_fit_width(4)
        mathy.to_corner(DOWN + LEFT)
        bubble.pin_to(mathy)
        bubble.shift(LEFT)
        morty = Mortimer()
        morty.to_corner(DOWN + RIGHT)
        morty_bubble = SpeechBubble()
        morty_bubble.stretch_to_fit_width(4)
        morty_bubble.pin_to(morty)
        bubble.write("""
            Did you know a curve \\\\
            can fill all space?
        """)
        morty_bubble.write("Who cares?")

        self.add(mathy, morty)
        for bub, buddy in [(bubble, mathy), (morty_bubble, morty)]:
            self.play(Transform(Point(bub.get_tip()), bub))
            self.play(ShimmerIn(bub.content))
            self.play(
                ApplyMethod(buddy.blink,
                            rate_func=squish_rate_func(there_and_back)))
示例#3
0
def get_mathy_and_bubble():
    mathy = Mathematician()
    mathy.to_edge(DOWN).shift(4*LEFT)
    bubble = SpeechBubble(initial_width = 8)
    bubble.pin_to(mathy)
    return mathy, bubble