ManimCommunity / ManimCommunity/manim
Add initialisation-using-substring support for `Text`, similar to `Tex`
@SamuilYu is already working on this.
Since May 16, 2021.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Enhancement proposal
Currently, `Tex` supports initialisation using multiple strings. This allows for easy access of substrings which is useful for say changing the color of a substring only. I think it would be great for `Text` to have this functionality as well.
```python3
class Example(Scene):
def construct(self):
tex = Tex("This is ", "tex (actually plain text)", "using multiple strings")
tex[0].set_color(RED)
tex[2].set_color(GREEN)
self.play(Write(tex))
text = Text("Can't initialise using multiple strings")
self.play(Write(text))
self.wait()
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.