我的蜜蜂不会出现。在绘制循环中加载和显示图像的正确方法是什么?
/* @pjs preload="/static/uploaded_resources/p.8706/Flower-Ice-icon.png"; */
/* @pjs preload="/static/uploaded_resources/p.8706/bee.png"; */
void setup() { // this is run once.
PImage img;
PImage bee;
// set the background color
background(255);
// canvas size (Variable aren't evaluated. Integers only, please.)
size(256, 256);
img = loadImage("/static/uploaded_resources/p.8706/Flower-Ice-icon.png");
bee = loadImage("/static/uploaded_resources/p.8706/bee.png");
image(img, 0, 0);
}
void draw() { // this is run repeatedly.
image(bee, mouseX, mouseY);
}
以下是草图的链接:http://studio.sketchpad.cc/sp/pad/view/VfC92Mrf5o/rev.119
答案 0 :(得分:2)
Pjs不支持使用多个预加载。相反,您需要逗号分隔这两个图像作为单个预加载命令的参数。请参阅http://processingjs.org/reference/preload,“多个图像的语法”