Layer.beginTransition

Function/Meaning
Start transition
Type
Method of Layer class
Syntax
beginTransition(name, withchildren=true, transsrc=null, options=%[ ])
Arguments
name Specifies the transition name.
By default, 'crossfade', 'universal' (Universal Transition), and 'scroll' (Scroll Transition) are defined.
withchildren Whether to perform the transition including child layers. If true, the transition includes child layers. If false, only the layer executing the method transitions.
transsrc Specifies the layer to be transitioned from (the source layer). Some transitions (such as those that transition independently) may not require this.
options Specifies transition options as a dictionary array.
Required options vary depending on the transition type.
Regardless of the transition type, 'selfupdate' and 'callback' members can be specified as common options.

If the 'selfupdate' member is true, Kirikiri will no longer perform automatic screen updates. In this case, the program must update the screen appropriately using methods like the Layer.update method. This feature is useful when you want to perfectly synchronize transition rendering with program rendering.

If a TJS2 method is specified in the 'callback' member, that method is called every time rendering actually occurs. This method (the callback method) should return a 'tick' value of 0 or greater. Many transitions perform the transition based on the 'tick' value, which is the actual time in milliseconds. By implementing this callback method to return an arbitrary tick, you can rewind the transition effect to any point or fast-forward it, allowing control over the transition regardless of actual time. Many transitions consider the value specified in the 'time' member of the options to be the end of the transition. Therefore, for example, by specifying an appropriate value like 1000 for 'time' and returning a value less than 1000 in this callback method, you can display the transition at any stage. Also, in many transitions, the transition stops when the 'tick' value reaches the value specified in 'time'. If you do not want the transition to stop, ensure that you always specify a value less than the 'time' value.
Return Value
None (void)
Description
Starts the transition.
When withchildren=true, the entire parent-child tree structure is swapped with the transition source specified by transsrc upon completion.
When withchildren=false, only the transition source layer and the layer that executed the method (the transition destination layer) are swapped.
Note that in both cases, the swap occurs within the tree structure.
This method only starts the transition and returns immediately.