def construct(self): circle = Circle(color=PURPLE_A) square = Square(fill_color=GOLD_B, fill_opacity=1, color=GOLD_A) square.move_to(UP + LEFT) circle.surround(square) rectangle = Rectangle(height=2, width=3) ellipse = Ellipse(width=3, height=1, color=RED) ellipse.shift(2 * DOWN + 2 * RIGHT) pointer = CurvedArrow(2 * RIGHT, 5 * RIGHT, color=MAROON_C) arrow = Arrow(LEFT, UP) arrow.next_to(circle, DOWN + LEFT) rectangle.next_to(arrow, DOWN + LEFT) circle2 = Circle() circle2.surround(rectangle, buffer_factor=1) ring = Annulus(inner_radius=.5, outer_radius=1, color=BLUE) ring.next_to(ellipse, RIGHT) self.add(pointer) self.add(circle2) self.play(FadeIn(square)) self.play(Rotating(square), FadeIn(circle)) self.play(GrowArrow(arrow)) self.play(GrowFromCenter(rectangle), GrowFromCenter(ellipse), GrowFromCenter(ring)) self.wait()
def add_border(self): border = Square(side_length = self.board.get_height()) border.move_to(self.board.get_center()) self.add(border) self.border = border