Kodi Community Forum

Full Version: How to create a blinking animation?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
You'd think would be basic stuff but I can't find any discussion or documentation anywhere. How can I make a label blink on and off for a few seconds?
You can make a fade with a time of x on and a delay off with loop.....

You may could use pulse but I find that harder to control

Lastly you can use the alarm clock to trigger the action with a looping clock...

For me doing the holiday moda the basic animation with a loop I think will be the easiest just have to get the trigger,or condition right
This sort of thing?

Code:
<visible>String.EndsWith(System.Time(ss),0) | String.EndsWith(System.Time(ss),2) | String.EndsWith(System.Time(ss),4) | String.EndsWith(System.Time(ss),6) | String.EndsWith(System.Time(ss),8)</visible>

It's how I get the : to blink in the clock -

Image

https://github.com/HitcherUK/skin.firetv...nu.xml#L36
Heh, that's smart. It's also too long an interval, unfortunately, though I could maybe *just* work with it. Thanks.
That how I made my scroll widget I just used alarm clock to trigger the Animation.
Code:
                    <animation effect="fade" start="100" end="0" delay="350" time="350" loop="true" condition="true">conditional</animation>

depends how anal you want to get about the 'blink', ie. this is it more or less, but isn't a blink as in on off switch, but you cant tell really. Wink
you could maybe mess with dooby things.. erm, elastics or w/e they called..
That would be great for holiday effects Christmas lights hehehe ideas
Another way (probably uses less resources):

Code:
<control type="list">
    <width>64</width>
    <height>108</height>
    <scrolltime>0</scrolltime>
    <autoscroll time="500">true</autoscroll>
    <visible>true</visible>
    <orientation>vertical</orientation>
    <itemlayout height="108">
        <control type="label">
            <width>auto</width>
            <aligny>center</aligny>
            <font>Black-22</font>
            <textcolor>Color1</textcolor>
            <label>$INFO[ListItem.Label]</label>
        </control>
    </itemlayout>
    <focusedlayout height="108">
        <control type="label">
            <width>auto</width>
            <aligny>center</aligny>
            <font>Black-22</font>
            <textcolor>Color1</textcolor>
            <label>$INFO[ListItem.Label]</label>
        </control>
    </focusedlayout>
    <content>
        <item>
            <label>on</label>
            <onclick>noop</onclick>
        </item>
        <item>
            <label></label>
            <onclick>noop</onclick>
        </item>
    </content>
</control>
Clever.
Code:
    <variable name="blinky">
        <value condition="String.EndsWith(System.Time(ss),0) | String.EndsWith(System.Time(ss),2) | String.EndsWith(System.Time(ss),4) | String.EndsWith(System.Time(ss),6) | String.EndsWith(System.Time(ss),8)">$INFO[Skin.String(mystring)]</value>
        <value></value>
    </variable>

Still a second though, dont know if there is a system variable for absolute time in milliseconds.