drop() 是一个 p5.js 元素方法,它在每次有文件加载到元素中时注册一个回调。上传的文件会被创建成一个 p5.File 类。你可以使用 drop() 回调函数来检查文件类型,然后编写条件语句来处理文件类型。
图片拖放: Revised by Kasey Lichtlyter. 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!