window_mouse_set

设置窗口内的鼠标位置为指定值。

语法:

window_mouse_set(x, y);


参数 描述
x 窗口内的x坐标
y 窗口内的y坐标


返回:N/A


描述

有了这个函数,你可以更改游戏窗口的鼠标位置,这在FPS游戏中非常有用。这个函数只有焦点在游戏中时有用,所以使用 alt + tab时 将会解锁鼠标。

注意:对于常规的鼠标函数请参见鼠标输入部分。


例如:

window_mouse_set(window_get_width() / 2, window_get_height() / 2);

上述代码将鼠标在游戏窗口中居中放置。


上一页:游戏窗口
下一页:window_center
© Copyright YoYo Games Ltd. 2018 All Rights Reserved