Hey, could anyone explain to me how to properly use SetAlpha to change item alpha value?

Hey, could anyone explain to me how to properly use SetAlpha to change item alpha value?

]]>

9 Commentsto Hey, could anyone explain to me how to properly use SetAlpha to change item alpha value?

  1. Anonymous says:

    < ![CDATA[

    alpha is a property, so you need to edit the properties of the item concerned.


    In general to edit properties you have to do it in this way:



    1st – you need to take in input the item by name or id



    2nd – edit the properties and then commit


       


          item(generic name).getProperties().edit()


          .setInteger(“some name(in this case i.alpha)”,some int value(int this case 0 – 255 or a var))


         .commit()


     

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Simone Boccuzzi​ Thank you very much! Now it works ☺

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Patryk Goworowski your welcome! 🙂


    Are you going to make item alpha changing through scroll?

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Simone Boccuzzi​ You read in my mind, haha 😁

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Patryk Goworowski LOL! Follow this little explanation



    create a var linked with the x or y scroll:



    var desk = LL.getCurrentDesktop(); //or get a container in input


    var x = desk.getPositionX(); //or Y



    the assign it to a var:



    var a = x/some int value;



    conditions:



    if(a>255) a=255;


    if(a<0) a=0;



    put this var in properties editor and you will have alpha changing through scroll.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Simone Boccuzzi​ Thanks, but I made the script work already. I just couldn’t figure out how to change item alpha with script. 😀

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Patryk Goworowski Perfect just as well xD

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Simone Boccuzzi Just a quick optimization for clipping conditions:


    var a=Math.min(Math.max([alphacalculation],0),255);

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Lutz Linke mmh, interesting… I’ve never used Math functions. I think i should take a note and gather more information about them

    ]]>

Leave a Reply

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