diff --git a/zh-cn/application-dev/reference/apis/js-apis-animator.md b/zh-cn/application-dev/reference/apis/js-apis-animator.md index 6b5126c7919a0532dd5202a9a4d60c5747bf4857..58c4fa86b393d85039068c5272565443898b6295 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-animator.md +++ b/zh-cn/application-dev/reference/apis/js-apis-animator.md @@ -254,7 +254,7 @@ animatorResult.onrepeat = function() { | 名称 | 类型 | 必填 | 说明 | | ---------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | | duration | number | 是 | 动画播放的时长,单位毫秒。 | -| easing | string | 是 | 动画插值曲线,仅支持以下可选值:
"linear":动画线性变化。
"ease":动画开始和结束时的速度较慢,cubic-bezier(0.25、0.1、0.25、1.0)。
"ease-in":动画播放速度先慢后快,cubic-bezier(0.42, 0.0, 1.0, 1.0)。
"ease-out":动画播放速度先快后慢,cubic-bezier(0.0, 0.0, 0.58, 1.0)。
"ease-in-out":动画播放速度先加速后减速,cubic-bezier(0.42, 0.0, 0.58, 1.0)。
"fast-out-slow-in":标准曲线,cubic-bezier(0.4,0.0,0.2,1.0)。
"linear-out-slow-in":减速曲线,cubic-bezier(0.0,0.0,0.2,1.0)。
"friction":阻尼曲线,cubic-bezier(0.2, 0.0, 0.2, 1.0)。
"extreme-deceleration":急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。
"rhythm":节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。
"sharp":锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。
"smooth":平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。
cubic-bezier(x1, y1, x2, y2):在三次贝塞尔函数中定义动画变化过程,入参的值必须处于0-1之间。
steps(number, step-position):阶梯曲线。number必须设置,支持的类型为int。step-position参数可选,支持设置start或end,默认值为end。 | +| easing | string | 是 | 动画插值曲线,仅支持以下可选值:
"linear":动画线性变化。
"ease":动画开始和结束时的速度较慢,cubic-bezier(0.25、0.1、0.25、1.0)。
"ease-in":动画播放速度先慢后快,cubic-bezier(0.42, 0.0, 1.0, 1.0)。
"ease-out":动画播放速度先快后慢,cubic-bezier(0.0, 0.0, 0.58, 1.0)。
"ease-in-out":动画播放速度先加速后减速,cubic-bezier(0.42, 0.0, 0.58, 1.0)。
"fast-out-slow-in":标准曲线,cubic-bezier(0.4,0.0,0.2,1.0)。
"linear-out-slow-in":减速曲线,cubic-bezier(0.0,0.0,0.2,1.0)。
"friction":阻尼曲线,cubic-bezier(0.2, 0.0, 0.2, 1.0)。
"extreme-deceleration":急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。
"rhythm":节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。
"sharp":锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。
"smooth":平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。
"cubic-bezier(x1,y1,x2,y2)":三次贝塞尔曲线,x1、x2的值必须处于0-1之间。例如"cubic-bezier(0.42,0.0,0.58,1.0)"。
"steps(number,step-position)":阶梯曲线,number必须设置,为正整数,step-position参数可选,支持设置start或end,默认值为end。例如"steps(3,start)"。 | | delay | number | 是 | 动画延时播放时长,单位毫秒,设置为0时,表示不延时。 | | fill | "none" \| "forwards" \| "backwards" \| "both" | 是 | 动画执行后是否恢复到初始状态,动画执行后,动画结束时的状态(在最后一个关键帧中定义)将保留。
"none":在动画执行之前和之后都不会应用任何样式到目标上。
"forwards":在动画结束后,目标将保留动画结束时的状态(在最后一个关键帧中定义)。
"backwards":动画将在animation-delay期间应用第一个关键帧中定义的值。当animation-direction为"normal"或"alternate"时应用from关键帧中的值,当animation-direction为"reverse"或"alternate-reverse"时应用to关键帧中的值。
"both":动画将遵循forwards和backwards的规则,从而在两个方向上扩展动画属性。 | | direction | "normal" \| "reverse" \| "alternate" \| "alternate-reverse" | 是 | 动画播放模式。
"normal": 动画正向循环播放。
"reverse": 动画反向循环播放。
"alternate":动画交替循环播放,奇数次正向播放,偶数次反向播放。
"alternate-reverse":动画反向交替循环播放,奇数次反向播放,偶数次正向播放。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-curve.md b/zh-cn/application-dev/reference/apis/js-apis-curve.md index 702aeef3b370eb2d4754430a2e6ad8b536ad9fb6..876d4bb42771c4b6cca76d1914349becf9e5b40b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-curve.md +++ b/zh-cn/application-dev/reference/apis/js-apis-curve.md @@ -78,7 +78,7 @@ stepsCurve(count: number, end: boolean): ICurve | 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ----| ------------------------------------------------------------ | -| count | number | 是 | 阶梯的数量,需要为正整数。
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按值为0处理。 | +| count | number | 是 | 阶梯的数量,需要为正整数。
取值范围:[1, +∞) | | end | boolean | 是 | 在每个间隔的起点或是终点发生阶跃变化。
-true:在终点发生阶跃变化。
-false:在起点发生阶跃变化。 | **返回值:** @@ -108,9 +108,9 @@ cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve **参数:** | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | ------------------------------------------------------------ | -| x1 | number | 是 | 确定贝塞尔曲线第一点横坐标。
取值范围:[0, 1]
**说明:**
设置的值小于0时,按0处理;设置的值大于1时,按1处理。 | +| x1 | number | 是 | 确定贝塞尔曲线第一点横坐标。
取值范围:[0, 1] | | y1 | number | 是 | 确定贝塞尔曲线第一点纵坐标。
取值范围:(-∞, +∞) | -| x2 | number | 是 | 确定贝塞尔曲线第二点横坐标。
取值范围:[0, 1]
**说明:**
设置的值小于0时,按0处理;设置的值大于1时,按1处理。 | +| x2 | number | 是 | 确定贝塞尔曲线第二点横坐标。
取值范围:[0, 1] | | y2 | number | 是 | 确定贝塞尔曲线第二点纵坐标。
取值范围:(-∞, +∞) | **返回值:** @@ -141,9 +141,9 @@ springCurve(velocity: number, mass: number, stiffness: number, damping: number): | 参数名 | 类型 | 必填 | 说明 | | --------- | ------ | ---- | ------------------------------------------------------------ | | velocity | number | 是 | 初始速度。是由外部因素对弹性动效产生的影响参数,其目的是保证对象从之前的运动状态平滑的过渡到弹性动效。
取值范围:(-∞, +∞) | -| mass | number | 是 | 质量。弹性系统的受力对象,会对弹性系统产生惯性影响。质量越大,震荡的幅度越大,恢复到平衡位置的速度越慢。
取值范围:(0, +∞)
**说明:**
设置的值小于0时,按1处理。 | -| stiffness | number | 是 | 刚度。是物体抵抗施加的力而形变的程度。在弹性系统中,刚度越大,抵抗变形的能力越强,恢复到平衡位置的速度就越快。
取值范围:(0, +∞)
**说明:**
设置的值小于0时,按1处理。 | -| damping | number | 是 | 阻尼。是一个纯数,无真实的物理意义,用于描述系统在受到扰动后震荡及衰减的情形。阻尼越大,弹性运动的震荡次数越少、震荡幅度越小。
取值范围:(0, +∞)
**说明:**
设置的值小于0时,按1处理。 | +| mass | number | 是 | 质量。弹性系统的受力对象,会对弹性系统产生惯性影响。质量越大,震荡的幅度越大,恢复到平衡位置的速度越慢。
取值范围:(0, +∞) | +| stiffness | number | 是 | 刚度。是物体抵抗施加的力而形变的程度。在弹性系统中,刚度越大,抵抗变形的能力越强,恢复到平衡位置的速度就越快。
取值范围:(0, +∞) | +| damping | number | 是 | 阻尼。是一个纯数,无真实的物理意义,用于描述系统在受到扰动后震荡及衰减的情形。阻尼越大,弹性运动的震荡次数越少、震荡幅度越小。
取值范围:(0, +∞) | **返回值:** @@ -171,9 +171,9 @@ springMotion(response?: number, dampingFraction?: number, overlapDuration?: numb **参数:** | 参数名 | 类型 | 必填 | 说明 | | --------- | ------ | ---- | ----- | -| response | number | 否 | 弹簧自然振动周期,决定弹簧复位的速度。
默认值:0.55
单位:秒
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按默认值0.55处理。 | -| dampingFraction | number | 否 | 阻尼系数。
0表示无阻尼,一直处于震荡状态;
大于0小于1的值为欠阻尼,运动过程中会超出目标值;
等于1为临界阻尼;
大于1为过阻尼,运动过程中逐渐趋于目标值。
默认值:0.825
单位:秒
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按默认值0.55处理。 | -| overlapDuration | number | 否 | 弹性动画衔接时长。发生动画继承时,如果前后两个弹性动画response不一致,response参数会在overlapDuration时间内平滑过渡。
默认值:0
单位:秒
取值范围:[0, +∞)。
**说明:**
设置小于0的值时,按默认值0处理。
弹性动画曲线为物理曲线,[animation](../arkui-ts/ts-animatorproperty.md)、[animateTo](../arkui-ts/ts-explicit-animation.md)中的duration参数不生效,动画持续时间取决于springMotion动画曲线参数和之前的速度。时间不能归一,故不能通过该曲线的interpolate函数获得插值。 | +| response | number | 否 | 弹簧自然振动周期,决定弹簧复位的速度。
默认值:0.55
单位:秒
取值范围:[0, +∞) | +| dampingFraction | number | 否 | 阻尼系数。
0表示无阻尼,一直处于震荡状态;
大于0小于1的值为欠阻尼,运动过程中会超出目标值;
等于1为临界阻尼;
大于1为过阻尼,运动过程中逐渐趋于目标值。
默认值:0.825
单位:秒
取值范围:[0, +∞) | +| overlapDuration | number | 否 | 弹性动画衔接时长。发生动画继承时,如果前后两个弹性动画response不一致,response参数会在overlapDuration时间内平滑过渡。
默认值:0
单位:秒
取值范围:[0, +∞)。
**说明:**
弹性动画曲线为物理曲线,[animation](../arkui-ts/ts-animatorproperty.md)、[animateTo](../arkui-ts/ts-explicit-animation.md)中的duration参数不生效,动画持续时间取决于springMotion动画曲线参数和之前的速度。时间不能归一,故不能通过该曲线的interpolate函数获得插值。 | **返回值:** @@ -204,9 +204,9 @@ responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDurat **参数:** | 参数名 | 类型 | 必填 | 说明 | | --------- | ------ | ---- | ----- | -| response | number | 否 | 解释同springMotion中的response。
默认值:0.15
单位:秒
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按默认值0.15处理。 | -| dampingFraction | number | 否 | 解释同springMotion中的dampingFraction。
默认值:0.86
单位:秒
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按默认值0.86处理。 | -| overlapDuration | number | 否 | 解释同springMotion中的overlapDuration。
默认值:0.25
单位:秒
取值范围:[0, +∞)
**说明:**
设置小于0的值时,按默认值0.25处理。
弹性跟手动画曲线为springMotion的一种特例,仅默认值不同。如果使用自定义参数的弹性曲线,推荐使用springMotion构造曲线。如果使用跟手动画,推荐使用默认参数的弹性跟手动画曲线。
[animation](../arkui-ts/ts-animatorproperty.md)、[animateTo](../arkui-ts/ts-explicit-animation.md)中的duration参数不生效,动画持续时间取决于responsiveSpringMotion动画曲线参数和之前的速度,也不能通过该曲线的interpolate函数获得插值。 | +| response | number | 否 | 解释同springMotion中的response。
默认值:0.15
单位:秒
取值范围:[0, +∞) | +| dampingFraction | number | 否 | 解释同springMotion中的dampingFraction。
默认值:0.86
单位:秒
取值范围:[0, +∞) | +| overlapDuration | number | 否 | 解释同springMotion中的overlapDuration。
默认值:0.25
单位:秒
取值范围:[0, +∞)
**说明:**
弹性跟手动画曲线为springMotion的一种特例,仅默认值不同。如果使用自定义参数的弹性曲线,推荐使用springMotion构造曲线。如果使用跟手动画,推荐使用默认参数的弹性跟手动画曲线。
[animation](../arkui-ts/ts-animatorproperty.md)、[animateTo](../arkui-ts/ts-explicit-animation.md)中的duration参数不生效,动画持续时间取决于responsiveSpringMotion动画曲线参数和之前的速度,也不能通过该曲线的interpolate函数获得插值。 | **返回值:** @@ -239,7 +239,7 @@ interpolate(fraction: number): number | 参数名 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ------------------------------------------------------------ | -| fraction | number | 是 |  当前的归一化时间参数。
取值范围:[0,1]
**说明:**
设置的值小于0时,按0处理;设置的值大于1时,按1处理。 | +| fraction | number | 是 |  当前的归一化时间参数。
取值范围:[0,1] | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-matrix4.md b/zh-cn/application-dev/reference/apis/js-apis-matrix4.md index f7be54e6571aab57d00dcf5e53d7e9c31c5035d9..26c8e6e7099f4c783d92ed151007b2be73ef726b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-matrix4.md +++ b/zh-cn/application-dev/reference/apis/js-apis-matrix4.md @@ -149,6 +149,7 @@ import matrix4 from '@ohos.matrix4' @Component struct Test { private matrix1 = matrix4.identity().translate({ x: 100 }) + // 对matrix1的拷贝矩阵做scale操作,不影响到matrix1 private matrix2 = this.matrix1.copy().scale({ x: 2 }) build() { @@ -304,7 +305,7 @@ Matrix的坐标点转换函数,可以将当前的变换效果作用到一个 combine(options: Matrix4Transit): Matrix4Transit -Matrix的叠加函数,可以将两个矩阵的效果叠加起来生成一个新的矩阵对象。 +Matrix的叠加函数,可以将两个矩阵的效果叠加起来生成一个新的矩阵对象。会改变调用该函数的原始矩阵。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full @@ -328,8 +329,8 @@ import matrix4 from '@ohos.matrix4' @Entry @Component struct Test { - private matrix1 = matrix4.identity().translate({ x: 200 }).copy() - private matrix2 = matrix4.identity().scale({ x: 2 }).copy() + private matrix1 = matrix4.identity().translate({ x: 200 }) + private matrix2 = matrix4.identity().scale({ x: 2 }) build() { Column() { @@ -340,7 +341,7 @@ struct Test { .margin({ top: 50 }) // 先平移x轴200px,再缩放两倍x轴,得到矩阵变换后的效果图 Image($r("app.media.icon")) - .transform(this.matrix1.combine(this.matrix2)) + .transform(this.matrix1.copy().combine(this.matrix2)) .width("40%") .height(100) .margin({ top: 50 }) @@ -356,7 +357,7 @@ struct Test { invert(): Matrix4Transit -Matrix的逆函数,可以返回一个当前矩阵对象的逆矩阵,即效果正好相反。 +Matrix的逆函数,可以返回一个当前矩阵对象的逆矩阵,即效果正好相反。会改变调用该函数的原始矩阵。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full @@ -372,7 +373,7 @@ Matrix的逆函数,可以返回一个当前矩阵对象的逆矩阵,即效 import matrix4 from '@ohos.matrix4' // matrix1(宽放大2倍) 和 matrix2(宽缩小2倍) 效果相反 let matrix1 = matrix4.identity().scale({ x: 2 }) -let matrix2 = matrix1.invert() +let matrix2 = matrix1.copy().invert() @Entry @Component struct Tests { @@ -398,7 +399,7 @@ struct Tests { translate(options: TranslateOption): Matrix4Transit -Matrix的平移函数,可以为当前矩阵增加x轴/y轴/z轴平移效果。 +Matrix的平移函数,可以为当前矩阵增加x轴/y轴/z轴平移效果。会改变调用该函数的原始矩阵。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full @@ -442,7 +443,7 @@ struct Test { scale(options: ScaleOption): Matrix4Transit -Matrix的缩放函数,可以为当前矩阵增加x轴/y轴/z轴缩放效果。 +Matrix的缩放函数,可以为当前矩阵增加x轴/y轴/z轴缩放效果。会改变调用该函数的原始矩阵。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full @@ -486,7 +487,7 @@ struct Test { rotate(options: RotateOption): Matrix4Transit -Matrix的旋转函数,可以为当前矩阵增加x轴/y轴/z轴旋转效果。 +Matrix的旋转函数,可以为当前矩阵增加x轴/y轴/z轴旋转效果。会改变调用该函数的原始矩阵。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full @@ -599,9 +600,9 @@ struct Test { | 名称 | 类型 | 必填 | 说明 | | ------- | ------ | ---- | ------------------------------------------------------------ | -| x | number | 否 | x轴的缩放倍数。x>1时以x轴方向放大,x<1时以x轴方向缩小。
默认值:1
取值范围 [0, +∞)
**说明:**
设置小于0的值时,按照默认值处理。 | -| y | number | 否 | y轴的缩放倍数。y>1时以y轴方向放大,y<1时以y轴方向缩小。
默认值:1
取值范围 [0, +∞)
**说明:**
设置小于0的值时,按照默认值处理。 | -| z | number | 否 | z轴的缩放倍数。z>1时以z轴方向放大,z<1时以z轴方向缩小。
默认值:1
取值范围 [0, +∞)
**说明:**
设置小于0的值时,按照默认值处理。 | +| x | number | 否 | x轴的缩放倍数。x>1时以x轴方向放大,0<x<1时以x轴方向缩小,x<0时沿x轴反向并缩放。
默认值:1
取值范围 (-∞, +∞) | +| y | number | 否 | y轴的缩放倍数。y>1时以y轴方向放大,0<y<1时以y轴方向缩小,y<0时沿y轴反向并缩放。
默认值:1
取值范围 (-∞, +∞) | +| z | number | 否 | z轴的缩放倍数。z>1时以z轴方向放大,0<z<1时以z轴方向缩小,z<0时沿z轴反向并缩放。
默认值:1
取值范围 (-∞, +∞) | | centerX | number | 否 | 变换中心点x轴坐标。
默认值:0。
取值范围 (-∞, +∞) | | centerY | number | 否 | 变换中心点y轴坐标。
默认值:0。
取值范围 (-∞, +∞) | @@ -611,9 +612,9 @@ struct Test { | 名称 | 类型 | 必填 | 说明 | | ------- | ------ | ---- | ------------------------------------------------------- | -| x | number | 否 | 旋转轴向量x坐标。
默认值:1。
取值范围 (-∞, +∞) | -| y | number | 否 | 旋转轴向量y坐标。
默认值:1。
取值范围 (-∞, +∞) | -| z | number | 否 | 旋转轴向量z坐标。
默认值:1。
取值范围 (-∞, +∞) | +| x | number | 否 | 旋转轴向量x坐标。
默认值:0。
取值范围 (-∞, +∞) | +| y | number | 否 | 旋转轴向量y坐标。
默认值:0。
取值范围 (-∞, +∞) | +| z | number | 否 | 旋转轴向量z坐标。
默认值:0。
取值范围 (-∞, +∞)
**说明:** 旋转向量中x、y、z至少有一个不为0才有意义。 | | angle | number | 否 | 旋转角度。
默认值:0 | | centerX | number | 否 | 变换中心点x轴坐标。
默认值:0 | | centerY | number | 否 | 变换中心点y轴坐标。
默认值:0 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md b/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md index 8d38be12a656b2394ca1ca5c95922ed937527f87..13a78232ce4b16a7bab669b98be6be87677198dc 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-animatorproperty.md @@ -14,10 +14,10 @@ animation(value: {duration?: number, tempo?: number, curve?: string | Curve | IC | 名称 | 参数类型 | 必填 | 描述 | | ---------- | ------------------------------------------| ---- | ------------------------------------------------------------ | -| duration | number | 否 | 设置动画时长。
默认值:1000
单位:毫秒
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
- 在ArkTS卡片上最大动画持续时间为1000毫秒。
- 设置小于0的值时按0处理。
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | -| tempo | number | 否 | 动画播放速度。数值越大,动画播放速度越快,数值越小,播放速度越慢。
值为0时,表示不存在动画。
默认值:1
**说明:**
当设置小于0的值时按值为1处理。 | -| curve | string \| [Curve](ts-appendix-enums.md#curve) \| [ICurve](../apis/js-apis-curve.md#icurve)9+ | 否 | 设置动画曲线。默认曲线为线性。
默认值:Curve.Linear
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| delay | number | 否 | 设置动画延迟执行的时长。单位为毫秒,默认不延时播放。
默认值:0
取值范围:[0, +∞)
**说明:**
- 当设置的值小于0时按0处理。
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | +| duration | number | 否 | 设置动画时长。
默认值:1000
单位:毫秒
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
- 在ArkTS卡片上最大动画持续时间为1000毫秒。
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | +| tempo | number | 否 | 动画播放速度。数值越大,动画播放速度越快,数值越小,播放速度越慢。
值为0时,表示不存在动画。
默认值:1 | +| curve | string \| [Curve](ts-appendix-enums.md#curve) \| [ICurve](../apis/js-apis-curve.md#icurve)9+ | 否 | 设置动画曲线。
默认值:Curve.EaseInOut
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| delay | number | 否 | 设置动画延迟执行的时长。单位为毫秒,默认不延时播放。
默认值:0
取值范围:[0, +∞)
**说明:**
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | | iterations | number | 否 | 设置播放次数。
默认值:1
取值范围:[-1, +∞)
**说明:**
设置为-1时表示无限次播放。设置为0时表示无动画效果。 | | playMode | [PlayMode](ts-appendix-enums.md#playmode) | 否 | 设置动画播放模式,默认播放完成后重头开始播放。
默认值:PlayMode.Normal
从API version 9开始,该接口支持在ArkTS卡片中使用。
相关使用约束请参考PlayMode说明。 | | onFinish | () => void | 否 | 状态回调,动画播放完成时触发。
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
当iterations设置为-1时,动画效果无限循环不会停止,所以不会触发此回调。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md b/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md index 86e92bc13e58193a903a30dccfd33ada30508876..c45a5d0025c1de3f1ff7be5b940529dfbaca41ed 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-explicit-animation.md @@ -19,10 +19,10 @@ animateTo(value: AnimateParam, event: () => void): void | 名称 | 类型 | 描述 | | -------- | -------- | -------- | -| duration | number | 动画持续时间,单位为毫秒。
默认值:1000
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
- 在ArkTS卡片上最大动画持续时间为1000毫秒,若超出则固定为1000毫秒。
- 设置小于0的值时按0处理。
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | -| tempo | number | 动画的播放速度,值越大动画播放越快,值越小播放越慢,为0时无动画效果。
默认值:1.0
**说明:**
当设置小于0的值时按值为1处理。 | -| curve | [Curve](ts-appendix-enums.md#curve) \| [ICurve](../apis/js-apis-curve.md#icurve) \| string | 动画曲线。
默认值:Curve.Linear
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| delay | number | 单位为ms(毫秒),默认不延时播放。
默认值:0
**说明:**
- 当设置的值小于0时按0处理。
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | +| duration | number | 动画持续时间,单位为毫秒。
默认值:1000
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
- 在ArkTS卡片上最大动画持续时间为1000毫秒,若超出则固定为1000毫秒。
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | +| tempo | number | 动画的播放速度,值越大动画播放越快,值越小播放越慢,为0时无动画效果。
默认值:1.0 | +| curve | [Curve](ts-appendix-enums.md#curve) \| [ICurve](../apis/js-apis-curve.md#icurve)9+ \| string | 动画曲线。
默认值:Curve.EaseInOut
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| delay | number | 单位为ms(毫秒),默认不延时播放。
默认值:0
**说明:**
- 设置浮点型类型的值时,向下取整。例如,设置值为1.2,按照1处理。 | | iterations | number | 默认播放一次,设置为-1时表示无限次播放。
默认值:1 | | playMode | [PlayMode](ts-appendix-enums.md#playmode) | 设置动画播放模式,默认播放完成后重头开始播放。
默认值:PlayMode.Normal
从API version 9开始,该接口支持在ArkTS卡片中使用。
相关使用约束请参考PlayMode说明。 | | onFinish | () => void | 动效播放完成回调。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-motion-path-animation.md b/zh-cn/application-dev/reference/arkui-ts/ts-motion-path-animation.md index 7b7bbcf002c7b6c351e3ef1e0d21f809d1383b14..ec93ffb9920ac4e4784b9a555e9c6dc2ec70578c 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-motion-path-animation.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-motion-path-animation.md @@ -9,9 +9,9 @@ ## 属性 -| 名称 | 参数类型 | 默认值 | 描述 | -| -------- | -------- | -------- | -------- | -| motionPath | {
path: string,
from?: number,
to?: number,
rotatable?: boolean
}
**说明:**
path中支持使用start和end进行起点和终点的替代,如:
'Mstart.x start.y L50 50 Lend.x end.y Z',更多说明请参考[绘制路径](../../ui/ui-js-components-svg-path.md)。 | {
'',
0.0,
1.0,
false
} | 设置组件的运动路径,入参说明如下:
- path:位移动画的运动路径,使用svg路径字符串。
- from:运动路径的起点。
默认值:0.0
取值范围:[0, 1]
设置小于0的值时,按值为0处理。设置大于1的值时,按值为1处理。
- to:运动路径的终点。
默认值:1.0
取值范围:[0, 1]
设置小于0的值时,按值为0处理。设置大于1的值时,按值为1处理。
- rotatable:是否跟随路径进行旋转。 | +| 名称 | 参数类型 | 描述 | +| -------- | -------- | -------- | +| motionPath | {
path: string,
from?: number,
to?: number,
rotatable?: boolean
} | 设置组件的运动路径,入参说明如下:
- path:位移动画的运动路径,使用svg路径字符串。path中支持使用start和end进行起点和终点的替代,如:'Mstart.x start.y L50 50 Lend.x end.y Z',更多说明请参考[绘制路径](../../ui/ui-js-components-svg-path.md)。
- from:运动路径的起点。
默认值:0.0
取值范围:[0, 1]
- to:运动路径的终点。
默认值:1.0
取值范围:[0, 1]
- rotatable:是否跟随路径进行旋转。
默认值:false | ## 示例