New Animation (func, layers)
Parameters:
Func: This function is called once every frame. This function receives a parameter object containing four elements, in milliseconds.
{TimeDiff: "time difference between the previous frame and the current frame", lastTime: "time Difference Between the animation start and the previous frame", time: "time Difference Between the animation start and the current frame", frameRate: "animation execution frequency FPS "}
Layers: layer to be repainted for each animation frame. It can be a layer, a layer group, or null.
Method:
AddLayer: adds a layer to the current animation. If the layer is successfully added, true is returned. Otherwise, false is returned.
GetLayers (): Get all layers of the current animation.
IsRunning (): Check whether the current animation is being executed. If true is returned, false is returned.
SetLayers (layers): adds a batch of layers to the current animation. The addition method is the same as the layers parameter of the instantiation function.
Start (): starts an animation.
Stop (): stop the animation.