前几天开始学习p5.js,现在想用IntelliJ IDEA代替p5.js在线编辑器。像setup(),draw()和ellipse()函数这样的大多数东西都按预期工作,但该createCanvas()函数却没有 - 它带有绿色下划线并且错误消息显示“未解析的函数或方法 createCanvas()”。
我尝试使用 VSCode,它运行得很好,但我更喜欢使用 IntelliJ,所以我想知道我是否以及如果是的话,如何让它在 IntelliJ 中工作。
<script src="p5.js"></script> //p5.js is the file with all the code from the official p5js.org homepage.
<script src="sketch.js"></script> //sketch.js is the file where my code that should be executed is located
Run Code Online (Sandbox Code Playgroud)
function setup() { //The setup() function is recognized as expected,
createCanvas(1000, 1000); //But the createCanvas() function isn't.
}
Run Code Online (Sandbox Code Playgroud)