ProteinMotion
Reference navigation
On this page

TextGroup

Vertically arrange Text objects and animate a caption as one object. Child positions are ignored.

python
from proteinmotion import TextGroup

Constructor

python
TextGroup(*texts, position=(0.06, 0.08), gap=16)

Parameters

ParameterDefaultDescription
*texts—Text objects to arrange as one caption.
positionkeyword only(0.06, 0.08)Image coordinates (x, y), with (0, 0) at the top-left and (1, 1) at the bottom-right.
gapkeyword only16Vertical text gap in 1080p design pixels.

Methods and properties

NameDescription
glyph_countpropertyNumber of shaped glyphs used for writing animation.
snapshot()methodCapture the current state for deterministic timeline evaluation.
restore()methodRestore a state produced by snapshot().
layout()methodProject text and line geometry for the renderer at the current frame.
set_opacity()method · inherited from AnnotationSet or animate opacity in [0, 1].
move_to()method · inherited from AnnotationSet or animate text position in normalized image coordinates.
shift()method · inherited from AnnotationTranslate the object by an offset.
animateproperty · inherited from AnnotationCreate a builder for fluent animation calls. Pass the result to scene.play().
text_progressproperty · inherited from AnnotationCurrent reveal progress for glyphs and annotation lines.
python
TextGroup.glyph_count

Number of shaped glyphs used for writing animation.

python
TextGroup.snapshot()

Capture the current state for deterministic timeline evaluation.

Returns: State dictionary.

python
TextGroup.restore(state)

Restore a state produced by snapshot().

ParameterDefaultDescription
stateRequiredState returned by snapshot().

Returns: None

python
TextGroup.layout(camera, width, height)

Project text and line geometry for the renderer at the current frame.

ParameterDefaultDescription
cameraRequiredCamera used to project or frame objects.
widthRequiredImage width in pixels.
heightRequiredImage height in pixels.

Returns: AnnotationLayout containing glyph placements and line paths.

Inherited from annotations.Annotation.

python
TextGroup.set_opacity(opacity)

Set or animate opacity in [0, 1].

ParameterDefaultDescription
opacityRequiredOpacity in [0, 1], from transparent to opaque.

Returns: The object or animation builder.

Inherited from annotations.Annotation.

python
TextGroup.move_to(position)

Set or animate text position in normalized image coordinates.

ParameterDefaultDescription
positionRequiredImage coordinates (x, y), with (0, 0) at the top-left and (1, 1) at the bottom-right.

Returns: The annotation or animation builder.

Inherited from annotations.Annotation.

python
TextGroup.shift(offset)

Translate the object by an offset.

ParameterDefaultDescription
offsetRequiredOffset (x, y) in design pixels at 1080p for residue labels; normalized image units for text shifts.

Returns: The object or animation builder.

Inherited from annotations.Annotation.

python
TextGroup.animate

Create a builder for fluent animation calls. Pass the result to scene.play().

Inherited from annotations.Annotation.

python
TextGroup.text_progress

Current reveal progress for glyphs and annotation lines.