Hi guys.
Hi guys. Just started exploring scripting in lightning launcher. Whats the best way to animate an item from one place to another?
I just want a shortcut that on script activation, moves up with an animation.. How should I go about this.
I tried giving item.setposition(x,y); in a loop with certain timeout.But still on script execution the object is not getting animated, it just teleported to its new place. Any thoughts ?
]]>
< ![CDATA[
I’ll just show you one of my scripts. It’s changing the size, not the position and it changes the speed in between, but you can see the concept of an animation.
var d=LL.getCurrentDesktop();
var e=LL.getEvent();
var s=220;
var b=1134;
var m=d.getItemByLabel(“MusicWidget”);
var x=b-s;
var big=m.getHeight()
d.setPosition(0,0);
f();
function f()
{
if(x< =0||LL.isPaused())
{
m.setSize(720,big?b:s);
}
else
{
x=x*0.85-1;
m.setSize(720,big?b-x:s+x);
setTimeout(f,0);
}
}
]]>
< ![CDATA[
Maybe you don’t relinquish the processor in your loop. Make sure to use setTimeout somehow, so that it frees the processor and the launcher has a change to refresh the screen
]]>
< ![CDATA[
I guess the problem is the way you are using setTimeout
I could be wrong, but I can guess you are using setTimeout(function(),1000) instead of setTimeout(function,1000)
]]>