Animating on Scrolling
#1
Hello,
I'm trying to animate a control when the index of a scrolling list changes.
I have researched an index changed condition on a list but didn't find it however there are the following conditions:

Container(id).OnNext / Container(id).OnScrollNext
Container(id).OnPrevious / Container(id).OnScrollPrevious

Tested with all of them the animation don't fire when the index changes (pressing the arrow -> or <-)
the animation seems to fire randomly when scrolling to fast with the mouse Oo

Example:
PHP Code:
<control type="fixedlist" id="2">
      ... 
etc ...
</
control>

<
control type="image" id="3">
      ... 
etc ...
      <
animation type="TYPE" condition="Container(2).OnScrollNext" reversible="false">
        <
effect type="rotate" end="30" center="360,288" time="100"/>
      </
animation>
</
control

Should i be using another condition for the case i need, help !

Thanks Smile
I wrote a program to program my program ! - programception.
Reply
#2
OnScrollNext/OnScrollPrevious triggers only if the container is actually scrolling, OnNext/OnPrevious on every move to next or previous item. Problem is it's only true for 1 frame, so you have to do it a little differently if you want to animate your image on every move.

Use a condition with <visible>!Container.OnNext + !Container.OnPrevious</visible> and then use a visible animation to animate your image or whatever you want to animate. If you want different animation on OnNext & OnPrevious, you have to use 2 controls.
Image
Reply
#3
`Black Wrote:Use a condition with <visible>!Container.OnNext + !Container.OnPrevious</visible> and then use a visible animation to animate your image or whatever you want to animate. If you want different animation on OnNext & OnPrevious, you have to use 2 controls.

How exactly to use that condition .. insert it in the image control ? I'm still fairly new to this.
did you mean like this:
PHP Code:
<control type="image" id="3">
      ... 
etc ...
      <
animation type="TYPE" condition="Container(2).OnScrollNext" reversible="false">
        <
effect type="rotate" end="30" center="360,288" time="100"/>
      </
animation>
      <
visible>!Container.OnNext + !Container.OnPrevious</visible>
</
control
I wrote a program to program my program ! - programception.
Reply
#4
Yes and then use <animation type="Visible" reversible="false"></animation>.
Image
Reply
#5
Ok i have to bring the topic up again as the animation doesn't work as intended

Here is what I'm using:
PHP Code:
<animation type="Visible" effect="slide" start="100,0" end="0,0" time="1000" condition="Container(2).OnScrollNext" reversible="false">Conditional</animation

Which means the Container with ID 2 should execute the "slide" animation each time it scrolls to the next list item

But that is not what actually happens, what happens is that i can see the animation starts and ends instantly (flashes) in like ( 100~200ms ) although i adjusted to 1 sec

How do i reach the desire effect to actually slide the container for each scroll.

Thanks
I wrote a program to program my program ! - programception.
Reply
#6
How long is the scrolltime of your container?
Image
Reply
#7
`Black Wrote:How long is the scrolltime of your container?
its set to "time="1000"" .. however when i change the condition from "Container(2).OnScrollNext" to "Control.HasFocus(2)" with reversible set to true the slide animation executes correctly on focus and back up again when unfocus. But this is not the behavior I'm looking for. I want XBMC to blindly executes the animation regardless of its previous state aka reversible set to false but again it flashes :S
I wrote a program to program my program ! - programception.
Reply
#8
Try this:

Code:
<visible>!Container(2).OnNext</visible>
<animation effect="slide" start="100,0" end="0,0" time="1000" reversible="false">Visible</animation>
Image
Reply
#9
`Black Wrote:Try this:

Code:
<visible>!Container(2).OnNext</visible>
<animation effect="slide" start="100,0" end="0,0" time="1000" reversible="false">Visible</animation>

IT WORKS !
Thanks alot Black, although its weird you have to set the visibility to false each time you want to run the animation.
Thanks again Smile
I wrote a program to program my program ! - programception.
Reply
#10
That's because Container.OnNext/OnPrevious is true for only 1 frame. So if you move left or right, the visible animation triggers everytime. Smile
Image
Reply
#11
Hello, I need advice on a variation of this animation:

I added a condition so that the animation will only trigger when a property is present.
Code:
            <visible>!Container(55).OnNext+!Container(55).OnPrevious | IsEmpty(Container(55).ListItem.Property(preview_ar)) </visible>
            <animation type="Visible" reversible="false" >
                <effect type="slide" start="0,0" end="-200,0" time="1000" delay="1000"/>
                <effect type="fade"  start="100" end="100" time="0" />
            </animation>

It works as expected but I'm missing an extra step to reset the control to it's original state.

example:
I use this to auto-hide listbox55 if there is a large preview image. (denoted by the preview_ar property)
when the user selects a listitem that trigger the animation, it works as expected.
but when the user selects another listitem that does not trigger the animation, listbox55 is still hidden (it is stuck in the state where the last animation left it on)

How do I add that extra trigger/conditoin to reset listbox55 back to its original state?
Reply

Logout Mark Read Team Forum Stats Members Help
Animating on Scrolling1