Set the position of the mouse||doc135756

September 20, 2022

Format

 GameSettings:setMousePos(x, y, immd) 

Description

Set the position where the user interacts with the device (move the mouse, slide the touch screen). You can simulate the effect of moving the camera when the user interacts with the device by setting a series of position points.


Precautions

  • When setting the interactive position point, if you need to imitate the sliding screen, you need to set the interactive movement state to true to take effect. It is recommended to usebeginMouseMoveto set the starting point and set the interactive movement state to true

Parameters

Variable name type Description
x float The x coordinate relative to the upper left corner of the screen
y float The y coordinate relative to the upper left corner of the screen
immd boolean Whether to clear the interactive location point path history


Code Samples

Blockman.Instance().gameSettings:setMousePos(25.0,25.0,false)
Blockman.Instance().gameSettings:setMousePos(50.0,50.0,false)