Page 1 of 1

[solved] About ways to use Animation System

Posted: Fri Sep 03, 2010 03:17
by spracle
As we know, there are 3 ways to use the animation system: pure code, Falagard looknfeel XML, and code && separate XML .

Is there any possibility that I can use it in a layout,such as:

Code: Select all

<Window Type="TaharezLook/Editbox" Name="TextDemo/editAge" >
         <Property Name="Text" Value="18" />
         <Property Name="MaxTextLength" Value="1073741823" />
         <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
         <Property Name="UnifiedAreaRect" Value="{{0.309388,0},{0.497488,0},{0.361665,0},{0.548012,0}}" />
    ...
         <AnimationDefinition name="Testing" duration="0.3" replayMode="once">
          <Affector property="Alpha" interpolator="float">
               < KeyFrame position="0.0" value="1.0" />
               <KeyFrame position="0.3" value="0.5" />
          </Affector>
          <Affector property="YRotation" interpolator="float">
               <KeyFrame position="0.0" value="0" />
               <KeyFrame position="0.3" value="10" />
          </Affector>
     </AnimationDefinition>   
</Window>

Re: About ways to use Animation System

Posted: Fri Sep 03, 2010 09:51
by spracle
confirmed that couldn't configure it in a layout , :(
But I can't figure out why? I think it more flexible to use layout xml than looknfeel xml

being confused ....

Re: About ways to use Animation System

Posted: Fri Sep 03, 2010 10:26
by emarcotte
I think the 'expected' approach would be to define the animation like you would in the animation/looknfeel xml, then reference it via code. Layouts are sort of like instantiations of the looknfeel's so you shouldn't really be defining the looknfeel in the layout :)

I could see it being useful to reference animations in the layout, however. Not sure if that possible at the moment, still haven't had enough time to use this as thoroughly as I'd like

Re: About ways to use Animation System

Posted: Fri Sep 03, 2010 16:39
by Jamarr
Agree. It is nice to be able to assign animations to types of windows across the board, but sometimes you only want an animation applied to one instance. Right now, I think you can only do that via code; extending the layout xml to support this would definitely be beneficial. I'll send a PM to Kulik so maybe he will come and respond to this ;)

Re: About ways to use Animation System

Posted: Sat Sep 04, 2010 02:31
by spracle
Imagine these situations:
1.a kind of StaticImage that can fade away,and all I need is fade away over the time ;
2. another kind of StaticImage that can change its "image" property over the time
3. another kind of StaticImage that can change its size over the time .
...

Every new kind of StaticImage Animation need to be configured in the looknfeel, meanwhiles I may well use this kind of widget only once .Next time,when I need another kind of StaticImage animation,i have to create a new widget (that also
in all probability be used by only one time) . This obviously is kind of waste.

Re: About ways to use Animation System

Posted: Sat Sep 04, 2010 15:31
by Kulik
I think there certainly are use cases where this would be really useful. On the other hand, you can't alter look n feel in layouts and just allowing animations here doesn't sound right to me.

It also isn't as easy to just crudely plug the animations here, because the window would have to track the instances and definitions and not only create them (easy) but also delete them. Right now there is no way to do this and we previously agreed that CEGUI::Window shouldn't be "tainted" by animations... Look n feel tracks it's animations.

Re: About ways to use Animation System

Posted: Fri Sep 10, 2010 03:34
by rockoz
Every new kind of StaticImage Animation need to be configured in the looknfeel, meanwhiles I may well use this kind of widget only once .Next time,when I need another kind of StaticImage animation,i have to create a new widget (that also
in all probability be used by only one time) . This obviously is kind of waste.


spracle is right. Some animation behavior should not be widget type related.
But it is still a hard work to set image property if there are dozens of frames in the animation with layout support. :pint:

Re: About ways to use Animation System

Posted: Wed Sep 15, 2010 12:30
by spracle
rockoz wrote:spracle is right. Some animation behavior should not be widget type related.
But it is still a hard work to set image property if there are dozens of frames in the animation with layout support. :pint:


thanks :D Seriously I can't get what kulik have said(maybe because I am new to cegui),and I still think layout support will make animations more flexible

Re: About ways to use Animation System

Posted: Wed Sep 15, 2010 16:15
by Kulik
spracle: hehe, you probably have to know a bit about internals of CEGUI to know why it isn't such an easy fix :-) I don't want CEGUI to have separate animation loading implementations all over the place... I was thinking a bit more like providing looknfeel overrides inside layout files. But it's an evil thought... Would be a fun patch though 8)

Re: About ways to use Animation System

Posted: Thu Sep 16, 2010 00:55
by spracle
It's great work to build such animation system,and I appreciate what you have done very much ,kulik~~
I'm not quite familar with CEGUI,but i will work hard to get it.Now tough and fun :hammer: