Study
0,1 이 랜덤하게 움직이는 텍스트 박스 만들기
ovcos
2020. 10. 7. 17:02
0,1 이 가로와 세로에 맞게 랜덤하게 발생되는 식..
이펙트 패널엔 Slider control 3개가 필요하고
columns
rows
framerate
의 이름을 가져야 한다.
text 의 source text 에 적용.
// use sliders as variables for column, row, and frameRate
c = effect("columns")("Slider");
r = effect("rows")("Slider");
posterizeTime(effect("framerate")("Slider"));
// initialize the string we'll be using
s = '';
// outer loop for rows, inner loop for columns.
// add random zeros and ones through the duration of a line, then add a newline
for (i = 0; i < r; i++) {
for (j = 0; j < c; j++) {
s += parseInt(Math.round(random()));
}
s += "\n";
}
s;
// use sliders as variables for column, row, and frameRate
c = effect("columns")("Slider");
r = effect("rows")("Slider");
posterizeTime(effect("framerate")("Slider"));
// initialize the string we'll be using
s = '';
// outer loop for rows, inner loop for columns.
// add random zeros and ones through the duration of a line, then add a newline
for (i = 0; i < r; i++) {
for (j = 0; j < c; j++) {
s += parseInt(Math.round(random()));
}
s += "\n";
}
s;