
Note: The usage and API has changed a bit since this first post. Please check the README.md in the repository for latest docs.
Single-file, no-dependencies, no-surprises UI animation framework powered by ui.View.update, that enables writing intuitive animation scripts using generators:
@script
def sample(self):
self.move_to(50, 200)
self.pulse('red')
yield
self.hide()
The above script, when called as a function, will at the same time move the view and pulse the background in red, then hide it after the previous actions are complete. Scripter supports an arbitrarily complex combination of sections separated by yields, and calling several sub-scripts to get the combo you need, all coded in an intuitive and reliable way.
Check the repository or download the scripter.py file and run it to see a demo featuring showing and hiding, movement, color changes, counting, rotation, controlling several views simultaneously, animation easing functions, interaction with custom ui.View.draw, as well as pausing or cancelling the animation.
Checking the demo script code is probably the best way to get started, as real documentation is still on the todo list.
Features:
- Inherits ui.View, so you can enable it by inheriting Scripter to use all effects easily as in the example above.
- Or use as an animation control center by creating a Scripter instance, then presenting it or placing it as a hidden subview somewhere. All effects support providing the target view as a parameter.
- Animation primitives:
set_value(typically for arange)slide_valuetimer
- Animation effects:
hide,showmove_toslide_colorpulse(a color)rotate- ... more to come, feature requests welcome
- Cancel all animations or a specific script
- Pause and continue all animations
yield 'wait'- shorthand for pausing for the default duration (0.5 seconds), often needed to make animations feel more naturalslide_valueaccepts anease_funcparameter, for even more natural-feeling animations. Check the curves to pick the right function for the occasion.
Note: As of Sep 15, 2017, ui.View.update is only available in Pythonista 3 beta.

