mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 04:57:46 +00:00
Added ShowIncreasingSubsets
This commit is contained in:
parent
3226e4a946
commit
66075aa5d2
1 changed files with 11 additions and 0 deletions
|
|
@ -113,6 +113,17 @@ class Write(DrawBorderThenFill):
|
|||
else:
|
||||
self.run_time = 2
|
||||
|
||||
|
||||
class ShowIncreasingSubsets(Animation):
|
||||
def __init__(self, group, **kwargs):
|
||||
self.all_submobs = group.submobjects
|
||||
Animation.__init__(self, group, **kwargs)
|
||||
|
||||
def update_mobject(self, alpha):
|
||||
n_submobs = len(self.all_submobs)
|
||||
index = int(alpha * n_submobs)
|
||||
self.mobject.submobjects = self.all_submobs[:index]
|
||||
|
||||
# Fading
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue