Posted by: pierrot | on May 26, 2015
Posted in | 9 Comments » Tags:
< ![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()
]]>
Simone Boccuzzi Thank you very much! Now it works ☺
Patryk Goworowski your welcome! 🙂
Are you going to make item alpha changing through scroll?
Simone Boccuzzi You read in my mind, haha 😁
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.
Simone Boccuzzi Thanks, but I made the script work already. I just couldn’t figure out how to change item alpha with script. 😀
Patryk Goworowski Perfect just as well xD
Simone Boccuzzi Just a quick optimization for clipping conditions:
var a=Math.min(Math.max([alphacalculation],0),255);
Lutz Linke mmh, interesting… I’ve never used Math functions. I think i should take a note and gather more information about them
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
< ![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()
]]>
< ![CDATA[
Simone Boccuzzi Thank you very much! Now it works ☺
]]>
< ![CDATA[
Patryk Goworowski your welcome! 🙂
Are you going to make item alpha changing through scroll?
]]>
< ![CDATA[
Simone Boccuzzi You read in my mind, haha 😁
]]>
< ![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.
]]>
< ![CDATA[
Simone Boccuzzi Thanks, but I made the script work already. I just couldn’t figure out how to change item alpha with script. 😀
]]>
< ![CDATA[
Patryk Goworowski Perfect just as well xD
]]>
< ![CDATA[
Simone Boccuzzi Just a quick optimization for clipping conditions:
var a=Math.min(Math.max([alphacalculation],0),255);
]]>
< ![CDATA[
Lutz Linke mmh, interesting… I’ve never used Math functions. I think i should take a note and gather more information about them
]]>