【发布时间】:2021-09-28 06:59:42
【问题描述】:
var boat,groundImage; //variables declared
function preload(){
boat = loadAnimation("b2.png"); //loading animation
groundImage = loadImage("b1.jpg");
}
function setup() {
createCanvas(600, 400); //draw canvas
}
function draw()
{
background(180);
image(groundImage,0,0);
animation(boat,0,0); //locate animation
}
这里是在 p5.js 编辑器中使用动画的简单代码。但我收到一个错误:ReferenceError: loadAnimation is not defined at /sketch.js:6:3
【问题讨论】:
标签: javascript web animation editor p5.js