Layer.beginTransition

Function/Meaning

Start of transition

Type
Layerclassmethod of
Syntax
beginTransition(name, withchildren=true, transsrc=null, options)
Arguments
name

Specify the transition name.
By default,'crossfade','universal', and'scroll' are defined.

withchildren

Whether the child layer also transitions with it.
If true is specified, the transition will be made for each child layer.
If false is specified, only the layer that executes the method will transition.

transsrc

Specify the layer to switch to.
Some transitions may not need to be specified (for example, transitions by themselves).

options

Specifies transition options in a dictionary array.
The options you need depend on the type of transition.
Regardless of the type of transition, the options that can be specified in common are the'selfupdate'member and the'callback' member.
If the'selfupdate'member is true, KiriKiri will not automatically update the screen.
In this case, he has to update the screen with the Layer.update method etc. on the program side as appropriate.
This feature is useful if you want the transition drawing to be perfectly synchronized with the program drawing.
If you specify a TJS2 method in the'callback'member, that method will be called each time the drawing is actually done.
This method (callback method) should return a'tick' value of 0 or greater.
Many transitions are based on the'tick'value, which is the actual time in milliseconds, but by implementing this callback method to return any tick, the transition's transition You can rewind the effect at any point, fast forward in the middle, and control the transition regardless of the actual time.
Many transitions consider the value specified in the optional'time'member to be the end of the transition.
So, for example, you can specify an appropriate value such as 1000 for the option'time', and in this callback method he will return a value less than 1000 to display the transition at any stage. You will be able to do it.
Also, for many transitions, the transition will stop when the'tick' value reaches the value specified by the optional'time', so if you don't want to stop the transition, the value specified by'time' Always specify a value less than or equal to.

Return value
None (void)
Explanation

Start the transition.
When children = true, the transition has a parent-child tree structure that is exactly the same as the transition source specified in transsrc at the end.
If children = false, only the layer from which the transition is made and the layer that executed the method (the layer to which the transition is made) are swapped.
Please note that in both cases, the tree structure is replaced.
This method returns immediately after initiating a transition.