Animation.rotate

Requires:
Base Library≥2.21.8

Method signature
Animation.rotate(angle: number)

Description

Rotate by an angle, range -180~180

Parameters

ParameterTypeRequiredDescription
anglenumberYesRotation angle, range -180~180

Return Value

Type: Animation
Animation instance

Examples

Rotate 45 degrees

Page({
  data: {
    animationData: {},
  },
  onReady() {
    const animation = ty.createAnimation({ duration: 500 });
    animation.rotate(45).step();
    this.setData({ animationData: animation.export() });
  },
});