Couldn’t resist doing a mockup of the spinning menu icon

Couldn’t resist doing a mockup of the spinning menu icon

]]>

10 Commentsto Couldn’t resist doing a mockup of the spinning menu icon

  1. Anonymous says:

    < ![CDATA[

    That’s great! How did you do that?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Greatly scripted rotation and blending. Looks IMHO better than that morphing-crap.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Of course it’s a script! 🙁 need to learn this language

    ]]>

  4. Anonymous says:

    < ![CDATA[

    How did you do the dark behind the folder panel?

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Benoît de Chezelles might be the script “dim background”

    ]]>

  6. Anonymous says:

    < ![CDATA[

    That’s also a script.. And it’s actually my own.. I wrote it before transparency worked very well and it’s actually using a gradient from transparent to black and item.setPosition

    ]]>

  7. Anonymous says:

    < ![CDATA[

    //EDIT: fixed a bug with -alpha causing flickering


    /* ———- CONFIG ———*/


    var panelW=540;


    /* —— END CONFIG —–*/



    var d=LL.getCurrentDesktop();


    var w=d.getWidth();


    var h=d.getHeight();


    var x=d.getPositionX();




    //select your items..


    menu=LL.getItemById(589825);


    var back=LL.getItemById(589831);



    //(I dont like if statements for one liners.. This is called a ‘Ternary Operator’ if you need to look it up)


    var rot=x<0?-x*180/(panelW):0;


    var alp=x<0?-x*255/(panelW):0;



    //the menu icon is above the back arrow, so we move it once the panel is completey visible


    var menuY=x==-panelW?-100:0;



    //this area feels sloppy.. can anyone tell me a better way to keep things from wiggling?


    menu.setRotation(0);


    back.setRotation(0);


    menu.setPosition(0,menuY);


    back.setPosition(0,0);


    menu.setRotation(rot);


    back.setRotation(rot);



    //set the alpha for the two icons


    menu.getProperties().edit().setInteger(“i.alpha”,255-alp).commit();


    back.getProperties().edit().setInteger(“i.alpha”,alp).commit();


    ]]>

  8. Anonymous says:

    < ![CDATA[

    Benoît de Chezelles here is the script for the icons rotation/alpha

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Ren Shore thanks a lot 🙂

    ]]>

  10. Anonymous says:

    < ![CDATA[

    The ternary operator ?: is the best! 😀



    For the rotation part, you are only rotating the items, so you don’t need to use the trick (my old trick? ) of reset rotation, set position, set rotation.


    Only with the setRotation should work.


    The issue is when the menu needs to be moved away. Try this, and check if it still is sloppy, if not maybe the problem is somewhere else.




    var hidden=x==-panelW;


    back.setRotation(rot);


    if(!hidden&&menu.getPositionY()!=0)menu.setPosition(0,0);


    menu.setRotation(rot);


    if(hidden)menu.setPosition(0,-100);

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *