首页 > 文档 > mousePressed判断鼠标是否按下
2017
07-14

mousePressed判断鼠标是否按下

1-6.mousePressed

Name(名称):mousePressed//鼠标按钮是否按下判断函数

Examples(例子):

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

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

void draw() {

if (mousePressed == true) {

fill(0);

} else {

fill(255);

}

rect(25, 25, 50, 50);

}

Description(描述):The mousePressed variable stores whether or not a mouse button is currently being pressed. The value is true when any mouse button is pressed, and false if no button is pressed. The mouseButton variable (see the related reference entry) can be used to determine which button has been pressed.

鼠标按下的变量存储是否正在按下鼠标按钮。当按下任何鼠标按钮时,值为true,如果没有按下按钮,则为false。mouseButton变量(参见相关参考条目)可用于确定已按哪个按钮。

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

 

 


 



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

留下一个回复

你的email不会被公开。