mirror of
https://github.com/3b1b/manim.git
synced 2025-11-15 17:27:45 +00:00
Ammend FadeInFromPoint and add FadeOutToPoint
This commit is contained in:
parent
349a9c9cea
commit
38f9686d68
1 changed files with 18 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
from manimlib.animation.animation import Animation
|
from manimlib.animation.animation import Animation
|
||||||
from manimlib.animation.transform import Transform
|
from manimlib.animation.transform import Transform
|
||||||
from manimlib.mobject.mobject import Group
|
from manimlib.mobject.mobject import Group
|
||||||
|
|
@ -53,7 +55,22 @@ class FadeOut(Fade):
|
||||||
|
|
||||||
class FadeInFromPoint(FadeIn):
|
class FadeInFromPoint(FadeIn):
|
||||||
def __init__(self, mobject, point, **kwargs):
|
def __init__(self, mobject, point, **kwargs):
|
||||||
super().__init__(mobject, shift=mobject.get_center() - point, **kwargs)
|
super().__init__(
|
||||||
|
mobject,
|
||||||
|
shift=mobject.get_center() - point,
|
||||||
|
scale=np.inf,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class FadeOutToPoint(FadeOut):
|
||||||
|
def __init__(self, mobject, point, **kwargs):
|
||||||
|
super().__init__(
|
||||||
|
mobject,
|
||||||
|
shift=point - mobject.get_center(),
|
||||||
|
scale=0,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class FadeTransform(Transform):
|
class FadeTransform(Transform):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue