Created
March 10, 2019 16:58
-
-
Save jaddoescad/8b605df33910f3ec19e76032c1caa31b to your computer and use it in GitHub Desktop.
Highlight Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from big_ol_pile_of_manim_imports import * | |
class RotateAndHighlight(Scene): | |
#Rotation of text and highlighting with surrounding geometries | |
def construct(self): | |
square=Square(side_length=5,fill_color=YELLOW, fill_opacity=1) | |
label=TextMobject("Text at an angle") | |
label.bg=BackgroundRectangle(label,fill_opacity=1) | |
label_group=VGroup(label.bg,label) #Order matters | |
label_group.rotate(TAU/8) | |
label2=TextMobject("Boxed text",color=BLACK) | |
label2.bg=SurroundingRectangle(label2,color=BLUE,fill_color=RED, fill_opacity=.5) | |
label2_group=VGroup(label2,label2.bg) | |
label2_group.next_to(label_group,DOWN) | |
label3=TextMobject("Rainbow") | |
label3.scale(2) | |
label3.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) | |
label3.to_edge(DOWN) | |
self.add(square) | |
self.play(FadeIn(label_group)) | |
self.play(FadeIn(label2_group)) | |
self.play(FadeIn(label3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment