目录

Class (FontSizeAnimation)

Modules to Import

import { map } from '@kit.MapKit';

FontSizeAnimation

Animation class for controlling the font size, which inherits from Animation.

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since version 4.1.0(11).

System capability: SystemCapability.Map.Core

Since: 4.1.0(11)

[h2]constructor

constructor(fromSize: number, toSize: number)

Creates an animation instance for controlling the font size. You can initialize the animation by specifying the start font size and target font size.

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since version 4.1.0(11).

System capability: SystemCapability.Map.Core

Since: 4.1.0(11)

Parameters:

Name Type Mandatory Description
fromSize number Yes Initial font size, in px. The value range is [0, 100], in pixels. Invalid values are not processed.
toSize number Yes Target font size, in px. The value range is [0, 100], in pixels. Invalid values are not processed.

Example:

let animation: map.FontSizeAnimation = new map.FontSizeAnimation(5, 25);