L3 Zhang
L3 Zhang

Reputation: 105

Hide mouse pointer (small hand) in A-Frame scene

I would ask a simple question.

Is there some methods to hide the mouse pointer(small hand) in a-scene?

I have tried css cursor: none on body tag. But it doesn't.

Thanks for any help.

demo: https://glitch.com/edit/#!/animated-gltf-opacity

Upvotes: 0

Views: 809

Answers (2)

Piotr Adam Milewski
Piotr Adam Milewski

Reputation: 14645

The styles load with the scene, try adding the css style after the scene is loaded.

 scene.addEventListener("loaded", (e)=> { (.a-canvasReference).style.cursor = "none")})

like i did here.

Upvotes: 2

Dan S.
Dan S.

Reputation: 331

Since it will be difficult to navigate with no visible mouse cursor (you will still need to click and drag to look, not knowing where your cursor is), it's probably best to enable pointer lock on the camera, which will automatically hide the cursor and eliminate the need to click and drag:

<a-camera look-controls="pointerLockEnabled: true;"></a-camera>

Upvotes: 2

Related Questions