Document the limits to MoveTransition, check for errors.

This commit is contained in:
Tom Rothamel
2023-06-18 02:08:18 -04:00
parent 22b3106504
commit 1a62894650
2 changed files with 16 additions and 0 deletions
+13
View File
@@ -455,6 +455,11 @@ def MoveTransition(delay, old_widget=None, new_widget=None, enter=None, leave=No
Returns a transition that interpolates the position of images (with the
same tag) in the old and new scenes.
As only layers have tags, MoveTransitions can only be applied to a single
layer or all layers at once, using the with statement. It will not work
in other contexts, like ATL, :doc:`ComposeTransition`, or other ways of
applying transitions.
`delay`
The time it takes for the interpolation to finish.
@@ -488,6 +493,14 @@ def MoveTransition(delay, old_widget=None, new_widget=None, enter=None, leave=No
A time warp function that's applied to images leaving the scene.
"""
if not (hasattr(old_widget, 'scene_list') or hasattr(old_widget, 'layers')):
if renpy.config.developer:
raise Exception("MoveTransition can only be applied to one or all layers, not %s." % type(old_widget).__name__)
if not (hasattr(new_widget, 'scene_list') or hasattr(new_widget, 'layers')):
if renpy.config.developer:
raise Exception("MoveTransition can only be applied to one or all layers, not %s." % type(new_widget).__name__)
use_old = old
def merge_slide(old, new, merge_slide):
+3
View File
@@ -43,6 +43,9 @@ statement. For example::
their new locations. An instance of the :func:`MoveTransition`
transition class.
Move transitions, and similar transitions like ease, can only be applied
to one or all layers, not individual displayables.
.. var:: moveinright
Also: **moveinleft, moveintop, moveinbottom**