首页 > 文档 > mouseMoved()鼠标移动
2017
07-14

mouseMoved()鼠标移动

 

1-4.mouseMoved()

Name(名称):mouseMoved()//可以看做是未按下鼠标按钮移动中断函数

Examples(例子):

// Move the mouse across the image把鼠标移过图像

// to change its value来改变它的颜色

int value = 0;

void draw() {

fill(value);

rect(25, 25, 50, 50);

}

void mouseMoved() {

value = value + 5;

if (value > 255) {

value = 0;

}

}

Description(描述):The mouseMoved() function is called every time the mouse moves and a mouse button is not pressed. (If a button is being pressed, mouseDragged() is called instead.)

当鼠标移动并没有按下鼠标按钮时,就会调用mouseMoved()函数。(如果一个按钮被按下,鼠标拖动()被调用。)

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(语法):mouseMoved()

mouseMoved(event)

Returns(返回值):Void(

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



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

留下一个回复

你的email不会被公开。