Hi everyone,
Thread topic pretty much sums it up : ).
I want to have a different origin than the default one for my transformation.
Here is my code:
ParallelAnimation {
id: testAnimationDuPath1
running: false
loops: 1
NumberAnimation { target: itemPrincipal; property: "rotation"; to: 360; duration: 1500 }
NumberAnimation { target: shell; property: "rotation"; to: 360; duration: 1500 }
}
ParallelAnimation {
id: testAnimationDuPath1
running: false
loops: 1
NumberAnimation { target: itemPrincipal; property: "rotation"; to: 360; duration: 1500 }
NumberAnimation { target: shell; property: "rotation"; to: 360; duration: 1500 }
}
To copy to clipboard, switch view to plain text mode
What arguments should I use and where should I put them?
Of maybe I need to use another function like RotationAnimation?
If so I have have the same question, I could not find a specific answer as to changing the rotation origin.
Yours,
--Jay
Added after 1 40 minutes:
I managed to change the origin of rotation by adding this into the concerned item:
transform: Rotation {
id: shellRotation
}
SequentialAnimation {
id: shellRotationAnimation
running: false
PropertyAction { target: shellRotation; property: "origin.x"; value: 408 }
PropertyAction { target: shellRotation; property: "origin.y"; value: 220 }
NumberAnimation { target: shellRotation; property: "angle"; to: 360; easing.type: Easing.OutQuad; duration: 500 }
}
transform: Rotation {
id: shellRotation
}
SequentialAnimation {
id: shellRotationAnimation
running: false
PropertyAction { target: shellRotation; property: "origin.x"; value: 408 }
PropertyAction { target: shellRotation; property: "origin.y"; value: 220 }
NumberAnimation { target: shellRotation; property: "angle"; to: 360; easing.type: Easing.OutQuad; duration: 500 }
}
To copy to clipboard, switch view to plain text mode
Never know. Might help people : )
--Jay
Bookmarks