小编luf*_*kou的帖子

为什么 fill() 会影响 p5.js 中的所有函数?

每当我fill()在 p5.js 中使用时,我所有的用户定义函数都会受到它的影响。为什么?

这是我的代码:

let a1 = a2 = 0;
function setup() {
    createCanvas(400, 400);
}

function draw() {
  background(200);
  fill(100,100,10);
  translate(width/2,height/2);
  angleMode(DEGREES);
  rotate(a1);
  ellipse(20,20,50,50);
  a1+=1;
  (20,20);
}

function rotateAbout(x,y){
  translate(x,y);
  angleMode(DEGREES);
  rotate(a2);
  ellipse(15,15,20,20);
  a2+=1;
}
Run Code Online (Sandbox Code Playgroud)

javascript processing p5.js

2
推荐指数
1
解决办法
458
查看次数

标签 统计

javascript ×1

p5.js ×1

processing ×1