[Qt-qml] Simple and reversible ?

Jason H scorp1us at yahoo.com
Sun Feb 6 16:00:52 CET 2011


The problem is if you do it in one animation, the from and two are the same so 
the middle of your 2000ms (total) animation would not be recognized.

I would probably look into making a C++ class which would accept your reverse 
property, and have it achieve 'to' in 1/2 the duration. You might be able to do 
that in JS as well too, but it won't kill performance, since you're just 
doctoring the values. 







________________________________
From: Attila Csipa <qt at csipa.in.rs>
To: qt-qml at qt.nokia.com
Sent: Sun, February 6, 2011 9:23:22 AM
Subject: [Qt-qml] Simple and reversible ?

 
Just to hear a few thoughts (in addition to the irc ones)... What's the simple 
way of doing back-and-forth animations *without* including additional states, 
grouping them in sequences or killing performance by doing it in JS ? Example:
Image{
id:glow
source:"glow.png"
SequentialAnimation{
running:true
loops:Animation.Infinite
PropertyAnimation{target:glow;property:"opacity";from:0.0;to:1.0;duration:1000;}
PropertyAnimation{target:glow;property:"opacity";from:1.0;to:0.0;duration:1000;}
}
}
Ideally, I would expect to see a single statement for this kind of things, i.e.
Image{
id:glow
source:"glow.png"
PropertyAnimation{property:"opacity";from:0.0;to:1.0;duration:1000; reversing: 
true}
}
Of course, I'm not emotionally attached to a particular syntax (loops: 
Animation.InfiniteReversing ? Some magical easing.type = Easing.Yoyo ?), but 
still, it would certainly cut down a lot of unnecessary syntax verbosity and we 
apparently already seem to have an unexposed direction attribute on the C++ 
side...
Attila


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110206/3fd29dc2/attachment-0001.html 


More information about the Qt-qml mailing list