diff --git a/zh-cn/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md b/zh-cn/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md index 18c71554d9f31d46a0784378aa8882310b5c0e12..a9796281090dc871c349e48859c0ddb8825094fc 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md +++ b/zh-cn/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md @@ -68,7 +68,9 @@ getPixelMap(): image.PixelMap; **示例:** ```ts -pixmap: PixelMap = drawable1.getPixelMap(); +let resManager = getContext().resourceManager +pixmap: PixelMap = ( (resManager.getDrawableDescriptor($r('app.media.icon') + .id))).getPixelMap(); ``` ## LayeredDrawableDescriptor.getPixelMap @@ -86,7 +88,9 @@ getPixelMap(): image.PixelMap; **示例:** ```ts -pixmap: PixelMap = layeredDrawable1.getPixelMap(); +let resManager = getContext().resourceManager +pixmap: PixelMap = ( (resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getPixelMap(); ``` ## LayeredDrawableDescriptor.getForeground @@ -104,7 +108,9 @@ getForeground(): DrawableDescriptor; **示例:** ```ts -drawable: DrawableDescriptor = layeredDrawable1.getForeground(); +let resManager = getContext().resourceManager +drawable: DrawableDescriptor = ( (resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getForeground(); ``` ## LayeredDrawableDescriptor.getBackground @@ -122,7 +128,9 @@ getBackground(): DrawableDescriptor; **示例:** ```ts -drawable: DrawableDescriptor = layeredDrawable1.getBackground(); +let resManager = getContext().resourceManager +drawable: DrawableDescriptor = ( (resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getBackground(); ``` ## LayeredDrawableDescriptor.getMask @@ -140,5 +148,7 @@ getMask(): DrawableDescriptor; **示例:** ```ts -drawable: DrawableDescriptor = layeredDrawable1.getMask(); +let resManager = getContext().resourceManager +drawable: DrawableDescriptor = ( (resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getMask(); ``` 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 34ce454b90266209340fbd2bf063e911b589bf54..28d1581bf7dcf820547767c2a17c47fc25626a0b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-curve.md +++ b/zh-cn/application-dev/reference/apis/js-apis-curve.md @@ -41,7 +41,7 @@ initCurve(curve?: Curve): ICurve **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 描述 | +| 名称 | 说明 | | ------------------- | ------------------------------------------------------------ | | Linear | 表示动画从头到尾的速度都是相同的。 | | Ease | 表示动画以低速开始,然后加快,在结束前变慢,CubicBezier(0.25, 0.1, 0.25, 1.0)。 | @@ -284,7 +284,7 @@ import Curves from '@ohos.curves' interpolate(fraction) { return Math.sqrt(fraction); } -private curve = Curves.customCurve(this.interpolate) // 创建一个用户自定义插值曲线 +let curve = Curves.customCurve(interpolate) // 创建一个用户自定义插值曲线 ``` 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 d5faea7e0aeb8762b5ab7db7d2286692dab3550d..5600a5521366ff4bb9bd2c578d8222e28d681d62 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-matrix4.md +++ b/zh-cn/application-dev/reference/apis/js-apis-matrix4.md @@ -27,7 +27,7 @@ Matrix的构造函数,可以通过传入的参数创建一个四阶矩阵, | 参数名 | 类型 | 必填 | 说明 | | ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| option | [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number] | 是 | 参数为长度为16(4\*4)的number数组, 详情见四阶矩阵说明。
默认值:
[1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1] | +| option | [number,number,number,number,
number,number,number,number,
number,number,number,number,
number,number,number,number] | 是 | 参数为长度为16(4\*4)的number数组, 详情见四阶矩阵说明。
默认值:
[1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1] | **返回值:** @@ -170,6 +170,132 @@ struct Test { ![zh-cn_image_0000001219744181](figures/zh-cn_image_0000001219744181.png) +## matrix4.invert(deprecated) + +invert(): Matrix4Transit + +Matrix的逆函数,可以返回一个当前矩阵对象的逆矩阵,即效果正好相反。 + +该接口从Api 10开始废弃。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**返回值:** + +| 类型 | 说明 | +| --------------------------------- | ---------------------- | +| [Matrix4Transit](#matrix4transit) | 当前矩阵的逆矩阵对象。 | + +## matrix4.combine(deprecated) + +combine(options: Matrix4Transit): Matrix4Transit + +Matrix的叠加函数,可以将两个矩阵的效果叠加起来生成一个新的矩阵对象。 + +该接口从Api 10开始废弃。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | --------------------------------- | ---- | ------------------ | +| option | [Matrix4Transit](#matrix4transit) | 是 | 待叠加的矩阵对象。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------- | ---------------------- | +| [Matrix4Transit](#matrix4transit) | 当前矩阵的逆矩阵对象。 | + +## matrix4.translate(deprecated) + +translate(options: TranslateOption): Matrix4Transit + +Matrix的平移函数,可以为当前矩阵增加x轴/y轴/z轴平移效果。 + +该接口从Api 10开始废弃。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ----------------------------------- | ---- | -------------- | +| option | [TranslateOption](#translateoption) | 是 | 设置平移参数。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------- | ---------------------- | +| [Matrix4Transit](#matrix4transit) | 当前矩阵的逆矩阵对象。 | + +## matrix4.scale(deprecated) + +scale(options: ScaleOption): Matrix4Transit + +Matrix的缩放函数,可以为当前矩阵增加x轴/y轴/z轴缩放效果。 + +该接口从Api 10开始废弃。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | --------------------------- | ---- | -------------- | +| option | [ScaleOption](#scaleoption) | 是 | 设置缩放参数。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------- | ---------------------- | +| [Matrix4Transit](#matrix4transit) | 当前矩阵的逆矩阵对象。 | + +## matrix4.rotate(deprecated) + +rotate(options: RotateOption): Matrix4Transit + +Matrix的旋转函数,可以为当前矩阵增加x轴/y轴/z轴旋转效果。 + +该接口从Api 10开始废弃。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ----------------------------- | ---- | -------------- | +| option | [RotateOption](#rotateoption) | 是 | 设置旋转参数。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------- | ---------------------- | +| [Matrix4Transit](#matrix4transit) | 当前矩阵的逆矩阵对象。 | + +## matrix4.transformPoint(deprecated) + +transformPoint(options: [number, number]): [number, number] + +Matrix的坐标点转换函数,可以将当前的变换效果作用到一个坐标点上。 + +该接口从Api 10开始废弃。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ---------------- | ---- | ------------------ | +| option | [number, number] | 是 | 需要转换的坐标点。 | + +**返回值:** + +| 类型 | 说明 | +| ---------------- | --------------------------- | +| [number, number] | 返回矩阵变换后的Point对象。 | + ## Matrix4Transit