MCPcopy Create free account
hub / github.com/acm-clan/algorithm-stone / __init__

Method __init__

animations/src/algo_node.py:5–20  ·  view source on GitHub ↗
(self, text, is_circle=False, **kwargs)

Source from the content-addressed store, hash-verified

3
4class AlgoNode(VGroup):
5 def __init__(self, text, is_circle=False, **kwargs):
6 super().__init__(**kwargs)
7 color = "#fff"
8 self.text_obj = Text(text, color=color, font="Consolas").scale(0.6)
9 self.text_sub_obj = Text("", color=color, font="Consolas").scale(0.6)
10
11 if is_circle:
12 self.outline_obj = Circle(color=color).scale(0.3)
13 else:
14 if 'is_rect' in self.__dict__ and self.is_rect:
15 self.outline_obj = Rectangle(color=color).scale(0.3)
16 else:
17 self.outline_obj = Square(color=color).scale(0.3)
18
19 self.text_sub_obj.shift(DR/4).set_color(RED)
20 self.add(self.text_obj, self.outline_obj, self.text_sub_obj)
21
22 def set_text(self, text):
23 color = "#fff"

Callers

nothing calls this directly

Calls 2

scaleMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected