Indicates whether "pointer lock" mode is currently active on the Game canvas. When pointer lock is active, the absolute position of the mouse, as returned by getPosition(), stays locked onto the same value. The mouse movements are reported with getPointerLockMovement() as increments/deltas relative to the previous frame. And the mouse cursor isn't visible on screen anymore.
Requests the browser to exit "pointer lock" mode on the Game canvas. When pointer lock is active, the absolute position of the mouse, as returned by getPosition(), stays locked onto the same value. The mouse movements are reported with getPointerLockMovement() as increments/deltas relative to the previous frame. And the mouse cursor isn't visible on screen anymore. Exiting pointer lock isn't immediate. It might take a couple of frames for isPointerLocked() to return false.
Returns how long the button has been held (0 if it's not held) in seconds.
Returns how much the mouse pointer moved, in CSS Pixel(???), since last frame, when in "pointer lock" mode. Returns the zero vector when not in "pointer lock" mode. When pointer lock is active, the absolute position of the mouse, as returned by getPosition(), stays locked onto the same value. The mouse movements are reported with getPointerLockMovement() as increments/deltas relative to the previous frame. And the mouse cursor isn't visible on screen anymore.
Gets the position, in CSS pixels, of the mouse pointer relative to the top-left corner of the 3D canvas used to render the Game.
When not provided, the method creates an object to store the result and then returns it. Providing this argument avoids this object allocation.
Gets how much the mouse wheel moved since last frame. The value are approximately measured in CSS pixels scrolled on screen (in a standard text-based webpage). The result is a Vector2. The x component is the delta value for the primary wheel which, on a typical mouse, is usually a physical wheel. Interacting with it on a standard text-based webpage scrolls the page vertically. The y component is the delta value for the secondary axis of the wheel, which scrolls a text-based webpage horizontally. Not all mice with wheel have such secondary axis. However, in most browsers, the secondary axis can be emulated by holding Shift and using the primary vertical axis. Lastly, laptop touchpads (or mice with touch surface, like the Apple Magic Mouse) also report wheel deltas whenever scrolling gestures occur. Zoom gestures, typically pinching with two fingers, are also reported as wheel deltas but the browser in this case indicates it by simulating/reporting the Control key as being pressed.
When not provided, the method creates an object to store the result and then returns it. Providing this argument avoids this object allocation.
Indicates whether the given button was just pressed this frame.
Indicates whether the given button was just released this frame.
Indicates whether the given mouse button is pressed. (either just pressed this frame, or being held from previous frames)
Requests the browser to enter "pointer lock" mode on the Game canvas. When pointer lock is active, the absolute position of the mouse, as returned by getPosition(), stays locked onto the same value. The mouse movements are reported with getPointerLockMovement() as increments/deltas relative to the previous frame. And the mouse cursor isn't visible on screen anymore. Entering pointer lock isn't immediate. It might take a couple of frames for isPointerLocked() to return true.
Gets all the buttons currently being held pressed as MouseButton bit field number.