---
name: "Animation.scale"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "Animation.scale - 缩放"
---

## Animation.scale

> [VERSION] Base Library >= 2.21.8

### Description

Scale

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `scaleX` | `number` | Yes | Scale factor on the X axis |
| `scaleY` | `number` | No | Scale factor on the Y axis; if omitted, defaults to the same as scaleX |

### Return Value

Type: `Animation`

Animation instance

### Examples

#### Uniform scaling

```ts
Page({
  data: {
    animationData: {},
  },
  onReady() {
    const animation = ty.createAnimation({ duration: 500 });
    animation.scale(2, 2).step();
    this.setData({ animationData: animation.export() });
  },
});
```
