这个例子绘制了一个圆,其位置随光标移动,但通过使用 constrain() 函数,确保圆始终保持在一个矩形内。
限制: Revised by Caleb Foss. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.
You can find the code history of these examples here: 2023 code, pre-2023 code. You can suggest improvements by contributing to the current website!