setPosition
in
Contributed Library Questions
•
1 year ago
I´ve never seen before this way of writing methods:
cp5.addBang("bang"+i)
.setPosition(40+i*80, 200)
.setSize(40, 40)
.setId(i)
;
.setPosition(40+i*80, 200)
.setSize(40, 40)
.setId(i)
;
I suposse it is not equivalent to:
cp5.addBang("bang"+i);
cp5.setPosition(40+i*80, 200);
cp5.setSize(40, 40);
cp5.setId(i);
cp5.setPosition(40+i*80, 200);
cp5.setSize(40, 40);
cp5.setId(i);
Because there are more semicolons. But setPosition is cp5 method and if I write cp5.setPosition(20,20); Im not telling the element to set the position. setPosition refers to the Bang, so it should be a bang method, but it is not. I dont understand this. For example if later I want to change the bang position, I dont know how to do it.
1