Reference navigation
On this page
TextGroup
Vertically arrange Text objects and animate a caption as one object. Child positions are ignored.
from proteinmotion import TextGroupConstructor
TextGroup(*texts, position=(0.06, 0.08), gap=16)Parameters
| Parameter | Default | Description |
|---|---|---|
*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 only | 16 | Vertical text gap in 1080p design pixels. |
Methods and properties
| Name | Description |
|---|---|
| glyph_countproperty | Number of shaped glyphs used for writing animation. |
| snapshot()method | Capture the current state for deterministic timeline evaluation. |
| restore()method | Restore a state produced by snapshot(). |
| layout()method | Project text and line geometry for the renderer at the current frame. |
| set_opacity()method · inherited from Annotation | Set or animate opacity in [0, 1]. |
| move_to()method · inherited from Annotation | Set or animate text position in normalized image coordinates. |
| shift()method · inherited from Annotation | Translate the object by an offset. |
| animateproperty · inherited from Annotation | Create a builder for fluent animation calls. Pass the result to scene.play(). |
| text_progressproperty · inherited from Annotation | Current reveal progress for glyphs and annotation lines. |
TextGroup.glyph_countNumber of shaped glyphs used for writing animation.
TextGroup.snapshot()Capture the current state for deterministic timeline evaluation.
Returns: State dictionary.
TextGroup.restore(state)Restore a state produced by snapshot().
| Parameter | Default | Description |
|---|---|---|
state | Required | State returned by snapshot(). |
Returns: None
TextGroup.layout(camera, width, height)Project text and line geometry for the renderer at the current frame.
| Parameter | Default | Description |
|---|---|---|
camera | Required | Camera used to project or frame objects. |
width | Required | Image width in pixels. |
height | Required | Image height in pixels. |
Returns: AnnotationLayout containing glyph placements and line paths.
Inherited from annotations.Annotation.
TextGroup.set_opacity(opacity)Set or animate opacity in [0, 1].
| Parameter | Default | Description |
|---|---|---|
opacity | Required | Opacity in [0, 1], from transparent to opaque. |
Returns: The object or animation builder.
Inherited from annotations.Annotation.
TextGroup.move_to(position)Set or animate text position in normalized image coordinates.
| Parameter | Default | Description |
|---|---|---|
position | Required | Image 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.
TextGroup.shift(offset)Translate the object by an offset.
| Parameter | Default | Description |
|---|---|---|
offset | Required | Offset (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.
TextGroup.animateCreate a builder for fluent animation calls. Pass the result to scene.play().
Inherited from annotations.Annotation.
TextGroup.text_progressCurrent reveal progress for glyphs and annotation lines.