(self)
| 398 | |
| 399 | class InteractiveDevelopment(Scene): |
| 400 | def construct(self): |
| 401 | circle = Circle() |
| 402 | circle.set_fill(BLUE, opacity=0.5) |
| 403 | circle.set_stroke(BLUE_E, width=4) |
| 404 | square = Square() |
| 405 | |
| 406 | self.play(Create(square)) |
| 407 | self.wait() |
| 408 | |
| 409 | # This opens an iPython terminal where you can keep writing |
| 410 | # lines as if they were part of this construct method. |
| 411 | # In particular, 'square', 'circle' and 'self' will all be |
| 412 | # part of the local namespace in that terminal. |
| 413 | # self.embed() |
| 414 | |
| 415 | # Try copying and pasting some of the lines below into |
| 416 | # the interactive shell |
| 417 | self.play(ReplacementTransform(square, circle)) |
| 418 | self.wait() |
| 419 | self.play(circle.animate.stretch(4, 0)) |
| 420 | self.play(Rotate(circle, 90 * DEGREES)) |
| 421 | self.play(circle.animate.shift(2 * RIGHT).scale(0.25)) |
| 422 | |
| 423 | # text = Text( |
| 424 | # """ |
| 425 | # In general, using the interactive shell |
| 426 | # is very helpful when developing new scenes |
| 427 | # """ |
| 428 | # ) |
| 429 | # self.play(Write(text)) |
| 430 | |
| 431 | # # In the interactive shell, you can just type |
| 432 | # # play, add, remove, clear, wait, save_state and restore, |
| 433 | # # instead of self.play, self.add, self.remove, etc. |
| 434 | |
| 435 | # # To interact with the window, type touch(). You can then |
| 436 | # # scroll in the window, or zoom by holding down 'z' while scrolling, |
| 437 | # # and change camera perspective by holding down 'd' while moving |
| 438 | # # the mouse. Press 'r' to reset to the standard camera position. |
| 439 | # # Press 'q' to stop interacting with the window and go back to |
| 440 | # # typing new commands into the shell. |
| 441 | |
| 442 | # # In principle you can customize a scene to be responsive to |
| 443 | # # mouse and keyboard interactions |
| 444 | # always(circle.move_to, self.mouse_point) |
| 445 | |
| 446 | |
| 447 | class SurfaceExample(Scene): |
nothing calls this directly
no test coverage detected