def get_text(self, text, scale=1, buff=0.1, invert_dir=False, invert_texto=False, remove_rot=False, **moreargs): linea_referencia = Line(self[0][0].get_start(), self[0][-1].get_end()) texto = TextMobject(text, **moreargs) ancho = texto.get_height() / 2 if invert_texto: inv = PI else: inv = 0 if remove_rot: texto.scale(scale).move_to(self) else: texto.rotate( linea_referencia.get_angle()).scale(scale).move_to(self) texto.rotate(inv) if invert_dir: inv = -1 else: inv = 1 texto.shift(self.direccion * (buff + 1) * ancho * inv) return texto
def add_size(self, text, scale=1, buff=0.1, **moreargs): linea_referencia = Line(self[0][0].get_start(), self[0][-1].get_end()) texto = TextMobject(text, **moreargs) ancho = texto.get_height() / 2 texto.rotate(linea_referencia.get_angle()) texto.shift(self.direccion * (buff + 1) * ancho) return self.add(texto)