PathInterpolator QML Type
パスに沿って手動でアニメーションを作成する方法を指定します。詳細...
| Import Statement: | import QtQuick |
プロパティ
詳細な説明
PathInterpolatorは、パス上の特定のprogress について、x 、y 、およびangle の情報を提供します。
次の例では、ベジエパスに沿って緑色の長方形をアニメーション表示しています。
import QtQuick
Rectangle {
width: 400
height: 400
PathInterpolator {
id: motionPath
path: Path {
startX: 0; startY: 0
PathCubic {
x: 350; y: 350
control1X: 350; control1Y: 0
control2X: 0; control2Y: 350
}
}
NumberAnimation on progress { from: 0; to: 1; duration: 2000 }
}
Rectangle {
width: 50; height: 50
color: "green"
//bind our attributes to follow the path as progress changes
x: motionPath.x
y: motionPath.y
rotation: motionPath.angle
}
}プロパティのドキュメント
angle : real [read-only]
このプロパティは、progress におけるパスの接線の角度を保持します。
角度は時計回りに報告され、3時の位置を0度とします。
path : Path
このプロパティには、補間を行うパスが格納されます。
パスの定義に関する詳細については、Path のドキュメントを参照してください。
progress : real
このプロパティには、パスに沿った現在の進行状況が格納されます。
PathInterpolator の一般的な使用法は、進行度を設定し(多くの場合、NumberAnimation を介して)、x、y、angleの対応する値を読み取ることです(多くの場合、これらの値へのバインディングを介して)。
進行度は 0.0 から 1.0 までの範囲です。
これらのプロパティは、progress におけるパスの位置を表します。
© 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.