Theater is a small framework for creating short 3D animation videos about UI components (Button, Alert, TopAppBar, Chip, etc.). It requires writing a plot of the video in kotlin. Then video can be viewed and rendered in realtime on an Android device.
- TODO
- TODO
Code of the already written video plots is a good starting point to learn Theater.
Theater uses animation API and
graphicsLayer
API from Jetpack Compose.
Each of the parameters in the graphicsLayer
modifier (rotation, scale, etc.) can be animated using
keyframes, thus creating a basic plot.
-
Stage: A rectangle with a size specified in pixels whose content is the content of the video. In fact, there is an invisible part of the stage — it goes beyond the edges of the screen. Its size is controlled by the setting
SizeConfig.stageSizeMultiplier
. E.g.:This is necessary in order to be able to:
- Place actors beyond the borders of the stage
- Place actors on stage with a size larger than the visible part of the stage (for example, a long text to scroll)
-
Actor: Single entity that can be animated with graphicsLayer parameters (rotation, scale, etc.). Each actor has 2
graphicsLayer
layers (Knobs
): one nested within the other. It is necessary to achieve more complex effects (slide a rotated actor in its plane). -
Lead Actor: Main, default actor. It can be accessed using the shortcuts available in
PlotScope
. -
Cast: List of actors.
-
Plot: a program written by the Theater user (Director) that performs actions on actors.
-
Backstage: 3D studio that helps to create keyframes for the plot using convenient Android UI.
-
Knobs: A class containing
graphicsLayer
variables wrapped inAnimatable
that can be animated in the plot.
- translationZ can't be set (as in "distance between 2 actors")
- "Fake" 3D space (if you rotate an object that contains an already rotated object, the internal object will look like a flat projection)
- No reflections, curved surfaces, 3D objects (spheres, boxes, cubes, pyramids, etc.)
Rendering of videos is recommended to be done on real devices, not emulators — a lot dropped frames and audio issues. You just need to start the screen recording and open the Render Video screen.
Terms from this domain are an excellent fit for naming building blocks of the framework: play, stage, plot, actor, backstage, cast, etc.