diff --git a/docs/source/animation.rst b/docs/source/animation.rst index 3fe878d5..e38db633 100644 --- a/docs/source/animation.rst +++ b/docs/source/animation.rst @@ -16,7 +16,13 @@ Animation are used in conjunction with ``scene.Play`` Fade ---- -FadeIn :download:`/assets/AnimationFadeIn.mp4`:: +.. raw:: html + + + +.. code-block:: python class AnimationFadeIn(Scene): def construct(self): @@ -27,9 +33,13 @@ FadeIn :download:`/assets/AnimationFadeIn.mp4`:: self.add(anno) self.play(FadeIn(square)) +.. raw:: html + -FadeOut :download:`/assets/AnimationFadeOut.mp4`:: +.. code-block:: python class AnimationFadeOut(Scene): def construct(self): @@ -43,7 +53,13 @@ FadeOut :download:`/assets/AnimationFadeOut.mp4`:: -FadeInFrom :download:`/assets/AnimationFadeInFrom.mp4`:: +.. raw:: html + + + +.. code-block:: python class AnimationFadeInFrom(Scene): def construct(self): @@ -60,7 +76,13 @@ FadeInFrom :download:`/assets/AnimationFadeInFrom.mp4`:: -FadeOutAndShift :download:`assets/AnimationFadeOutAndShift.mp4`:: +.. raw:: html + + + +.. code-block:: python class AnimationFadeOutAndShift(Scene): def construct(self): @@ -77,7 +99,13 @@ FadeOutAndShift :download:`assets/AnimationFadeOutAndShift.mp4`:: -FadeInFromLarge :download:`assets/AnimationFadeInFromLarge.mp4`:: +.. raw:: html + + + +.. code-block:: python class AnimationFadeInFromLarge(Scene): def construct(self): @@ -91,9 +119,13 @@ FadeInFromLarge :download:`assets/AnimationFadeInFromLarge.mp4`:: self.play(FadeInFromLarge(square, scale_factor=factor)) self.remove(anno, square) +.. raw:: html + -FadeInFromPoint :download:`assets/AnimationFadeInFromPoint.mp4`:: +.. code-block:: python class AnimationFadeInFromPoint(Scene): def construct(self): @@ -110,7 +142,13 @@ FadeInFromPoint :download:`assets/AnimationFadeInFromPoint.mp4`:: Grow ---- -GrowFromEdge :download:`assets/AnimationGrowFromEdge.mp4`:: +.. raw:: html + + + +.. code-block:: python class AnimationGrowFromEdge(Scene): def construct(self): @@ -127,7 +165,13 @@ GrowFromEdge :download:`assets/AnimationGrowFromEdge.mp4`:: -GrowFromCenter :download:`assets/AnimationGrowFromCenter.mp4`:: +.. raw:: html + + + +.. code-block:: python class AnimationGrowFromCenter(Scene): def construct(self): @@ -145,16 +189,22 @@ GrowFromCenter :download:`assets/AnimationGrowFromCenter.mp4`:: Diagonal Directions ------------------- -You can combine cardinal directions to form diagonal animations :download:`assets/AnimationFadeInFromDiagnal.mp4`:: +You can combine cardinal directions to form diagonal animations - class AnimationFadeInFromDiagnal(Scene): +.. raw:: html + + + +.. code-block:: python + + class AnimationFadeInFromDiagonal(Scene): def construct(self): square = Square() for diag in [UP + LEFT, UP + RIGHT, DOWN + LEFT, DOWN + RIGHT]: self.play(FadeInFrom(square, diag)) - - .. note:: You can also use the abbreviated forms like ``UL, UR, DL, DR``. See :ref:`ref-directions`. diff --git a/docs/source/assets/SquareToCircle.mp4 b/docs/source/assets/SquareToCircle.mp4 new file mode 100644 index 00000000..5b1e9b90 Binary files /dev/null and b/docs/source/assets/SquareToCircle.mp4 differ diff --git a/docs/source/conf.py b/docs/source/conf.py index 54a91b6c..81567716 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,4 +50,4 @@ html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ['assets'] diff --git a/docs/source/getting_started/learning_by_example.rst b/docs/source/getting_started/learning_by_example.rst index 5ad19693..96de24dd 100644 --- a/docs/source/getting_started/learning_by_example.rst +++ b/docs/source/getting_started/learning_by_example.rst @@ -64,7 +64,9 @@ and automatically play it. .. raw:: html - + Let's step through each line of the :class:`~scene.scene.Scene`. Lines 3 and 4 instantiate a :class:`~mobject.geometry.Circle` and