Continuous Label Animation Loop
#1
Question 
Hello all,
I think I just need a pointer in the right direction here so that I can figure out how to achieve this effect. Maybe someone here can help me.

What I'm trying to do:
I'd like to have 4+ different text strings slide-in and slide-out continuously over the course of video playback (using VideoFullScreen.xml). Basically, text 1 would appear at the beginning of the video, stay on screen for a few seconds, then would slide out to the left. after a 1 second delay the next block of text would slide in, stay on screen for a few seconds, then slide out to the left, etc.
I've been able to achieve this by having 4 separate label controls with different animation timers, however I cannot figure out how to make this effect loop continuously for the duration of video playback. Basically, it needs to go through each of the text strings, then start over from the beginning.

Where would I look to make this sort of thing happen?

Is this functionality only available using an add-on?

Ideally, the text strings would come from an RSS feed, but I'm almost positive I'd need to write an add-on to fetch the data and serve it up to the label control(s). I'd be happy to simply get it working with hardcoded text in the xml file.

Thanks in advance for any help/pointers that anyone can provide!
Reply
#2
Just use a fade label control, it does what you want in one control.
http://wiki.xbmc.org/index.php?title=Fade_label_control
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Hey Jurialmunkey...
Thanks for the response!

Unfortunately the Fadelabel control only fades in then scrolls out to the left. I'm going for more of a slide-in/slide-out effect to the right.

Any suggestions for that functionality?

Thanks again!
Reply
#4
Well, I figured out a way to hardcode it into the skin... however it looks as though you cannot have more than 2 animations per label control (is this a bug? If someone confirms this, I'll add an entry in the bug tracker).

I thought that it might work to do something like:
Code:
<control type="label" id="4">
                <description>Swap Text 1</description>
                <posx>352</posx>
                <posy>534</posy>
                <width>928</width>
                <height>95</height>
                <align>left</align>
                <aligny>center</aligny>
                <font>font45caps_title</font>
                <textcolor>white</textcolor>
                <label>Test One</label>
                <visible>Player.HasMedia+IntegerGreaterThan(VideoPlayer.Time,0)</visible>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,0)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,10)">Conditional</animation>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,20)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,30)">Conditional</animation>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,40)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,50)">Conditional</animation>
            </control>
            <control type="label" id="5">
                <description>Swap Text 2</description>
                <posx>352</posx>
                <posy>534</posy>
                <width>928</width>
                <height>95</height>
                <align>left</align>
                <aligny>center</aligny>
                <font>font45caps_title</font>
                <textcolor>white</textcolor>
                <label>Test Two</label>
                <visible>Player.HasMedia+IntegerGreaterThan(VideoPlayer.Time,10)</visible>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,10)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,20)">Conditional</animation>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,30)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,40)">Conditional</animation>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,50)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,60)">Conditional</animation>
            </control>

In this way, the two labels would alternately fade in for 10 seconds, fade out, then be replaced by the other for 10 seconds. This effect could be extended further by adding additional <animation> tags. More labels could be added as well by adjusting the timings.

I'm using the "fade" animation, however it could be swapped out for a slide-animation if needed.

Anyhow, the above only works for the first two animations... again, I'm not sure if this is by design, or if it's a bug, or if there's some tag I'm missing here.

Anyhow, the completely inefficient way I'm working around this is by creating duplicate labels with two animations attached:

Code:
<control type="label" id="4">
                <description>Swap Text 1</description>
                <posx>352</posx>
                <posy>534</posy>
                <width>928</width>
                <height>95</height>
                <align>left</align>
                <aligny>center</aligny>
                <font>font45caps_title</font>
                <textcolor>white</textcolor>
                <label>Test One</label>
                <visible>Player.HasMedia+IntegerGreaterThan(VideoPlayer.Time,0)</visible>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,0)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,10)">Conditional</animation>
            </control>
            <control type="label" id="5">
                <description>Swap Text 2</description>
                <posx>352</posx>
                <posy>534</posy>
                <width>928</width>
                <height>95</height>
                <align>left</align>
                <aligny>center</aligny>
                <font>font45caps_title</font>
                <textcolor>white</textcolor>
                <label>Test Two</label>
                <visible>Player.HasMedia+IntegerGreaterThan(VideoPlayer.Time,10)</visible>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,10)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,20)">Conditional</animation>
            </control>
            <control type="label" id="6">
                <description>Swap Text 1a</description>
                <posx>352</posx>
                <posy>534</posy>
                <width>928</width>
                <height>95</height>
                <align>left</align>
                <aligny>center</aligny>
                <font>font45caps_title</font>
                <textcolor>white</textcolor>
                <label>Test One</label>
                <visible>Player.HasMedia+IntegerGreaterThan(VideoPlayer.Time,20)</visible>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,20)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,30)">Conditional</animation>
            </control>
            <control type="label" id="7">
                <description>Swap Text 2a</description>
                <posx>352</posx>
                <posy>534</posy>
                <width>928</width>
                <height>95</height>
                <align>left</align>
                <aligny>center</aligny>
                <font>font45caps_title</font>
                <textcolor>white</textcolor>
                <label>Test Two</label>
                <visible>Player.HasMedia+IntegerGreaterThan(VideoPlayer.Time,30)</visible>
                <animation effect="fade" start="0" end="100" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,30)">Conditional</animation>
                <animation effect="fade" start="100" end="0" time="1500" condition="IntegerGreaterThan(VideoPlayer.Time,40)">Conditional</animation>
            </control>

It does work that way, however it gets very tedious and the XML gets huuge if you want to achieve this effect for minutes at a time.

Anyhow, thought I'd post this and see if anyone has some insight for me on a better method of doing this and whether the 2 animations per label thing is a bug... or perhaps this will help someone else in the future who's looking to achieve the same effect!
Reply
#5
Here is what i use:

Code:
<control type="group">
        <visible>Substring(Control.GetLabel(2121),b) | !Player.HasMedia</visible>
        <animation effect="fade" start="0" end="100" time="450" delay="150" >Visible</animation>
        <animation effect="fade" start="100" end="0" time="450" delay="150" >Hidden</animation>
            <control type="label">
                <include>TopLabelBig</include>
                <label>$INFO[System.Time(hh:mm)]</label>
            </control>
            <control type="label">
                <include>TopLabelSmall</include>
                <label>$INFO[System.Date(DDD)] $INFO[System.Date(dd)]</label>
            </control>
        </control>
        
        <control type="group">
        <visible>Player.HasMedia + Substring(Control.GetLabel(2121),a)</visible>
        <animation effect="fade" start="0" end="100" time="450" delay="150" >Visible</animation>
        <animation effect="fade" start="100" end="0" time="450" delay="150" >Hidden</animation>
            <control type="label">
                <include>TopLabelBig</include>
                <label>$INFO[Player.Title]</label>
            </control>
            <control type="label">
                <include>TopLabelSmall</include>
                <label>$INFO[VideoPlayer.TVShowTitle]$INFO[VideoPlayer.Year]$INFO[MusicPlayer.Artist]$INFO[VideoPlayer.ChannelName]</label>
            </control>
        </control>

        <control type="fadelabel" id="2121">
            <animation effect="fade" start="0" end="0" time="0" condition="true" >Conditional</animation>
            <include>TopLabelSmall</include>
            <label>a</label>
            <label>b</label>
            <scrollspeed>1200</scrollspeed>
            <pauseatend>17000</pauseatend>
            <visible>Player.HasMedia</visible>
        </control>

Includes.xml (make sure to change the font ect)
Code:
<include name="TopLabelBig">
    <left>700</left>
    <top>-4</top>
    <width>500</width>
    <height>42</height>
    <font>Clock2</font>
    <align>right</align>
    <aligny>center</aligny>
    <textcolor>FF959595</textcolor>
    <scroll>false</scroll>
</include>
<include name="TopLabelSmall">
    <left>700</left>
    <top>22</top>
    <width>500</width>
    <height>42</height>
    <font>WeatherSmall</font>
    <align>right</align>
    <aligny>center</aligny>
    <textcolor>FF707070</textcolor>
    <scroll>false</scroll>
</include>
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#6
Awesome!

Interesting passing the "a" and "b" strings via the fadelabel control,then testing for the condition in the control group animation. I will definitely use this method!

Thank you very much for this tidbit!
Reply
#7
Also helps keep the two grouped labels in sync, as opposed to using two fadelabels.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply

Logout Mark Read Team Forum Stats Members Help
Continuous Label Animation Loop0