1
我有一個背景圖片,我希望用戶認爲他們正在通過Processing
進行交互。圖像上有單詞列表,當用戶點擊單詞周圍的區域時,我想播放聲音併發送一個序列號給Arduino。mousePressed在處理中的某個區域
所有這一切,我不能得到mousePressed
代碼的權利。我現在正在用println("yikes")
進行測試,現在我在屏幕上單擊我就會看到「yikes」。
最重要的是,我發現了其他一些我無法弄清楚的錯誤。幫助讚賞。
void setup() {
size(1475, 995);
// The image file must be in the data folder of the current sketch
// to load successfully
img = loadImage("PaceTaker.jpg"); // Load the image into the program
}
void draw() {
// Displays the image at its actual size at point (0,0)
image(img, 0, 0);
}
void mousePressed() {
if (mouseX>105 && mouseX<337 && mouseY>696 && mouseY<714);
{
println("yikes");
stroke(0);
}
else println("hello"));
}