當前位置: 首頁>>代碼示例>>Python>>正文


Python VGroup.__init__方法代碼示例

本文整理匯總了Python中mobject.vectorized_mobject.VGroup.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python VGroup.__init__方法的具體用法?Python VGroup.__init__怎麽用?Python VGroup.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mobject.vectorized_mobject.VGroup的用法示例。


在下文中一共展示了VGroup.__init__方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from mobject.vectorized_mobject import VGroup [as 別名]
# 或者: from mobject.vectorized_mobject.VGroup import __init__ [as 別名]
 def __init__(self, **kwargs):
     digest_config(self, kwargs)
     videos = [VideoIcon() for x in range(self.num_videos)]
     VGroup.__init__(self, *videos, **kwargs)
     self.arrange_submobjects()
     self.scale_to_fit_width(2*SPACE_WIDTH-MED_LARGE_BUFF)
     self.gradient_highlight(*self.gradient_colors)
開發者ID:crclayton,項目名稱:manim,代碼行數:9,代碼來源:objects.py

示例2: __init__

# 需要導入模塊: from mobject.vectorized_mobject import VGroup [as 別名]
# 或者: from mobject.vectorized_mobject.VGroup import __init__ [as 別名]
 def __init__(self, mobject, **kwargs):
     VGroup.__init__(self, 
         Line(UP+LEFT, DOWN+RIGHT),
         Line(UP+RIGHT, DOWN+LEFT),
     )
     self.replace(mobject, stretch = True)
     self.set_stroke(self.stroke_color, self.stroke_width)
開發者ID:PythonJedi,項目名稱:manim,代碼行數:9,代碼來源:geometry.py

示例3: __init__

# 需要導入模塊: from mobject.vectorized_mobject import VGroup [as 別名]
# 或者: from mobject.vectorized_mobject.VGroup import __init__ [as 別名]
 def __init__(self, integer, **kwargs):
     num_str = str(integer)
     VGroup.__init__(self, *map(TexMobject, num_str), **kwargs)
     self.arrange_submobjects(
         RIGHT, buff = self.digit_buff, aligned_edge = DOWN
     )
     if num_str[0] == "-":
         self[0].next_to(self[1], LEFT, buff = SMALL_BUFF)
開發者ID:PythonJedi,項目名稱:manim,代碼行數:10,代碼來源:numerals.py

示例4: __init__

# 需要導入模塊: from mobject.vectorized_mobject import VGroup [as 別名]
# 或者: from mobject.vectorized_mobject.VGroup import __init__ [as 別名]
 def __init__(self, **kwargs):
     possible_values = map(str, range(1, 11)) + ["J", "Q", "K"]
     possible_suits = ["hearts", "diamonds", "spades", "clubs"]
     VGroup.__init__(self, *[
         PlayingCard(value = value, suit = suit, **kwargs)
         for value in possible_values
         for suit in possible_suits
     ])
開發者ID:PythonJedi,項目名稱:manim,代碼行數:10,代碼來源:probability.py

示例5: __init__

# 需要導入模塊: from mobject.vectorized_mobject import VGroup [as 別名]
# 或者: from mobject.vectorized_mobject.VGroup import __init__ [as 別名]
    def __init__(self, **kwargs):
        circle = Circle()
        ticks = []
        for x in range(12):
            alpha = x/12.
            point = complex_to_R3(
                np.exp(2*np.pi*alpha*complex(0, 1))
            )
            length = 0.2 if x%3 == 0 else 0.1
            ticks.append(
                Line(point, (1-length)*point)
            )
        self.hour_hand = Line(ORIGIN, 0.3*UP)
        self.minute_hand = Line(ORIGIN, 0.6*UP)
        # for hand in self.hour_hand, self.minute_hand:
        #     #Balance out where the center is
        #     hand.add(VectorizedPoint(-hand.get_end()))

        VGroup.__init__(
            self, circle, 
            self.hour_hand, self.minute_hand,
            *ticks
        )
開發者ID:aquafemi,項目名稱:manim,代碼行數:25,代碼來源:objects.py

示例6: __init__

# 需要導入模塊: from mobject.vectorized_mobject import VGroup [as 別名]
# 或者: from mobject.vectorized_mobject.VGroup import __init__ [as 別名]
 def __init__(self, **kwargs):
     VGroup.__init__(self)
     self.x_axis = NumberLine(**kwargs)
     self.y_axis = NumberLine(**kwargs).rotate(np.pi/2)
     self.add(self.x_axis, self.y_axis)
開發者ID:PythonJedi,項目名稱:manim,代碼行數:7,代碼來源:number_line.py


注:本文中的mobject.vectorized_mobject.VGroup.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。