Something like following could work if the distinct items cannot be bound
to the animation variable directly.
Item {
property int animvar: 0
onAnimvarChanged: {
piece.ball.x = animvar
player.x = animvar
}
NumberAnimation on animvar {
from: 0
to: player.nX
}
}
- Timo
On 1/25/12 11:08 AM, "Harri Pasanen" <[email protected]> wrote:
>Hi,
>
>Could you elaborate a bit? It is unclear to me how would I do that in
>clean fashion.
>
>Given that I have two (or more) distinct QML items, how do I tie a
>single animation to those?
>
>/Harri
>
>On 01/24/2012 12:42 PM, Timo Strömmer wrote:
>> Hi,
>>
>> Probably easiest would be to have a single animation over a variable and
>> then tie piece.ball.x and player.x to that.
>>
>> - Timo
>>
>> On 1/24/12 1:21 PM, "Harri Pasanen"<[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I found out that ParallelAnimation is not truly parallel, if I try to
>>> animate to objects
>>> moving next to one and other, like train wagons, I get overlaps.
>>>
>>> I'm trying to coax it into behaving by having a tiny pause, but it does
>>> not
>>> seem to help much
>>>
>>> ParallelAnimation {
>>> id: pushAnimHorizontal
>>> NumberAnimation { target: piece.ball; property: "x"; to:
>>> piece.ball.nX; duration: 170; easing.type: Easing.InOutQuad }
>>> SequentialAnimation { // trickery to avoid overlap
>>> PauseAnimation { duration: 30 }
>>> NumberAnimation { target: player; property: "x"; to:
>>>player.nX;
>>> duration: 170; easing.type: Easing.InOutQuad }
>>> }
>>> }
>>>
>>> Even with above I get the occasional overlap.
>>>
>>> I wonder what is the minimum duration in PauseAnimation on different
>>> platforms?
>>> I'm testing on Meego N9 right now.
>>>
>>> Or is there a better way?
>>>
>>> Thanks,
>>>
>>> Harri
>>> _______________________________________________
>>> Qt-qml mailing list
>>> [email protected]
>>> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>>
>
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml