本文整理汇总了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)
示例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)
示例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)
示例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
])
示例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
)
示例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)