Processing 处理:数字图像压缩
我试图创建100帧,其中数字0-100“打印”在每个帧的中心。如果我尝试下面的代码,我会得到一个错误“看起来你混合了“活动”和“静态”模式”Processing 处理:数字图像压缩,processing,Processing,我试图创建100帧,其中数字0-100“打印”在每个帧的中心。如果我尝试下面的代码,我会得到一个错误“看起来你混合了“活动”和“静态”模式” 尺寸(1440900); font=loadFont(“Arial-Black-96.vlw”); textFont(字体,96); int x=0; 作废提款(){ 背景(204); y=0; 如果(x
尺寸(1440900);
font=loadFont(“Arial-Black-96.vlw”);
textFont(字体,96);
int x=0;
作废提款(){
背景(204);
y=0;
如果(x<100){
文本(y、10、50);
x=x+1;
y=y+1;
}否则{
noLoop();
}
//将每个帧保存为screen-0001.tif、screen-0002.tif等。
saveFrame();
}
您需要在setup()函数中包装前3行。
比如:
void setup(){
规模(1440900);
font=loadFont(“Arial-Black-96.vlw”);
textFont(字体,96);
}
我没有运行代码就回答了这个问题,还有其他问题,这里是您的代码版本:
PFont字体;
int x=0;
int size=96;
无效设置(){
规模(1440900);
font=createFont(“Arial黑色”,大小);
文本字体(字体);
}
作废提款(){
背景(204);
if(x)
size(1440,900);
font = loadFont("Arial-Black-96.vlw");
textFont(font,96);
int x = 0;
void draw() {
background(204);
y=0;
if (x < 100) {
text(y, 10, 50);
x = x + 1;
y=y+1;
} else {
noLoop();
}
// Saves each frame as screen-0001.tif, screen-0002.tif, etc.
saveFrame();
}