Paragraph#

Qualified name: manim.mobject.text.text\_mobject.Paragraph

class Paragraph(*text, line_spacing=- 1, alignment=None, **config)[source]#

Bases: manim.mobject.types.vectorized_mobject.VGroup

Display a paragraph of text.

For a given Paragraph par, the attribute par.chars is a VGroup containing all the lines. In this context, every line is constructed as a VGroup of characters contained in the line.

Parameters
  • line_spacing (float, optional) – Represents the spacing between lines. Default to -1, which means auto.

  • alignment (str, optional) – Defines the alignment of paragraph. Default to “left”. Possible values are “left”, “right”, “center”

Examples

Normal usage:

paragraph = Paragraph('this is a awesome', 'paragraph',
                      'With \nNewlines', '\tWith Tabs',
                      '  With Spaces', 'With Alignments',
                      'center', 'left', 'right')

Remove unwanted invisible characters:

self.play(Transform(remove_invisible_chars(paragraph.chars[0:2]),
                    remove_invisible_chars(paragraph.chars[3][0:3]))

Methods

Attributes

animate

Used to animate the application of any method of self.

animation_overrides

color

depth

The depth of the mobject.

fill_color

If there are multiple colors (for gradient) this returns the first one

height

The height of the mobject.

sheen_factor

stroke_color

width

The width of the mobject.