Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add zorder to mobject #2057

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

germanzhu
Copy link

Motivation

Suggestion: Using z-order to define layer for Mobjects.

Proposed changes

  • mobject.py
  • scene.py

Test

Code:

from manimlib import *


class Video(Scene):
    
    def construct(self):
        s = Square(zorder=1).set_fill(RED,opacity=1)
        c = Circle(zorder=2).set_fill(BLUE,opacity=1)
        t = Triangle(zorder=0).scale(2).set_fill(GREEN,opacity=1)
        r = Rectangle(width=4,height=2,zorder=0).set_fill(PINK,opacity=1)
        self.play(ShowCreation(c))
        self.play(ShowCreation(s))
        self.play(ShowCreation(t))
        self.play(ShowCreation(r))

Result:

Video.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant