首页 > 文档 > mouseClicked()鼠标单击
2017
07-14

mouseClicked()鼠标单击

1-2.mouseClicked()

Name(名称):mouseClicked()//可以看做是鼠标按钮中断函数

Examples(例子):

// Click within the image to change单击图像中更改

// the value of the rectangle after矩形的颜色

// after the mouse has been clicked鼠标点击后

int value = 0;

void draw() {

fill(value);

rect(25, 25, 50, 50);

}

void mouseClicked() {

if (value == 0) {

value = 255;

} else {

value = 0;

}

}

Description(描述):The mouseClicked() function is called after a mouse button has been pressed and then released.


mouseClicked()函数在按下鼠标按钮之后调用,然后释放。

Mouse and keyboard events only work when a program has draw(). Without draw(), the code is only run once and then stops listening for events.


鼠标和键盘事件只在程序绘制()时才起作用。没有绘制(),代码只运行一次,然后停止监听事件。

Syntax(语法):mouseClicked()

mouseClicked(event)

Returns(返回值):Void(

Related(相关函数):mouseX
mouseY
pmouseX
pmouseY
mousePressed
mousePressed()
mouseReleased()
mouseClicked()
mouseMoved()
mouseDragged()

mouseButton
mouseWheel()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。