[solved] About ways to use Animation System

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

[solved] About ways to use Animation System

Postby spracle » Fri Sep 03, 2010 03:17

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>
Last edited by spracle on Mon Nov 01, 2010 12:32, edited 1 time in total.

User avatar
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

Re: About ways to use Animation System

Postby spracle » Fri Sep 03, 2010 09:51

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 ....

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: About ways to use Animation System

Postby emarcotte » Fri Sep 03, 2010 10:26

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

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: About ways to use Animation System

Postby Jamarr » Fri Sep 03, 2010 16:39

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 ;)
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

Re: About ways to use Animation System

Postby spracle » Sat Sep 04, 2010 02:31

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.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: About ways to use Animation System

Postby Kulik » Sat Sep 04, 2010 15:31

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.

rockoz
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Sep 22, 2009 02:26

Re: About ways to use Animation System

Postby rockoz » Fri Sep 10, 2010 03:34

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:

User avatar
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

Re: About ways to use Animation System

Postby spracle » Wed Sep 15, 2010 12:30

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

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: About ways to use Animation System

Postby Kulik » Wed Sep 15, 2010 16:15

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)

User avatar
spracle
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Aug 24, 2010 07:29

Re: About ways to use Animation System

Postby spracle » Thu Sep 16, 2010 00:55

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:


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests