本页内容

SpriteSequence QML Type

绘制精灵动画。更多...

Import Statement: import QtQuick
Inherits:

Item

属性

方法

详细说明

SpriteSequence 用于渲染和控制由 `Sprite ` 类型定义的一系列动画。

有关完整详情,请参阅“精灵动画”概述。

另请参阅 “使用 SpriteSequence 实现精灵动画”。

属性文档

currentSprite : string [read-only]

当前正在播放的Sprite 的名称。

goalSprite : string

动画应移动到的Sprite 的名称。

精灵状态具有预定义的持续时间和状态间的过渡;设置“goalSprite ”将导致系统忽略任何路径权重(包括“0 ”),并沿能最快到达“goalSprite ”(动画次数最少)的路径进行。系统将经过该路径上的中间状态,并按其持续时间进行动画播放。

如果能够从goalSprite 的起始点返回goalSprite ,它将持续这样做,直到goalSprite 被设置为"" 或一个无法到达的状态为止。

interpolate : bool

如果true ,系统会在精灵帧之间进行插值,以使动画看起来更流畅。

默认值为true 。

running : bool

该精灵是否正在动画播放。

默认值为true 。

sprites : list<Sprite> [read-only]

要绘制的精灵(一个或多个)。精灵将按此项的大小进行缩放。

方法文档

void jumpTo(string sprite)

此函数会使《SpriteSequence 》立即跳转至指定的《sprite 》;中间的精灵画面不会播放。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.