[Qt-qml] Simple and reversible ?
Vinayakam Murugan
mvinayakam at gmail.com
Sun Feb 6 15:49:50 CET 2011
Hello Attila
On Sun, Feb 6, 2011 at 6:23 AM, Attila Csipa <qt at csipa.in.rs> wrote:
> 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
>
There does seem a reversible option for Transitions. Maybe you could use
that
http://doc.qt.nokia.com/4.7-snapshot/qml-transition.html
reversible : bool <http://doc.qt.nokia.com/4.7-snapshot/qml-bool.html>
This property holds whether the transition should be automatically reversed
when the conditions that triggered this transition are reversed.
<http://doc.qt.nokia.com/4.7-snapshot/qml-transition.html>
Warm Regards
~~~~~~~~~~~~~~~
Vinayak
http://www.flickr.com/photos/rightplacerighttime/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110206/5060c548/attachment.html
More information about the Qt-qml
mailing list