首页 > 文档 > mouseX鼠标的当前水平坐标
2017
07-14

mouseX鼠标的当前水平坐标

1-9.mouseX

Name(名称):mouseX//鼠标的当前水平坐标

Examples(例子):

void draw() {

background(204);

line(mouseX, 20, mouseX, 80);

}

Description(描述):The system variable mouseX always contains the current horizontal coordinate of the mouse.

系统变量mouseX总是包含鼠标的当前水平坐标。

Note that Processing can only track the mouse position when the pointer is over the current window. The default value of mouseX is 0, so 0 will be returned until the mouse moves in front of the sketch window. (This typically happens when a sketch is first run.) Once the mouse moves away from the window, mouseX will continue to report its most recent position.

注意,当指针在当前窗口时,处理只能跟踪鼠标的位置。mouseX的默认值是0,所以0将会返回,直到鼠标移动到草图窗口前。(这通常发生在第一次运行草图的时候。)一旦鼠标离开窗口,mouseX将继续报告它最近的位置。

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



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

留下一个回复

你的email不会被公开。