Link GUI element to cursor

Hi guys,
I am trying to implement a “info plate” that appears next to the cursor if I hover over a mesh and shows some infos about the mesh. If I leave the mesh, it shall disappear again.
I know about the “OnPointerOverTrigger” and “OnPointerOutTrigger” actions, but I have clue how to link a plate (or a text or maybe a button) to the cursor.
Any ideas about this?

br and thanks

Hi.you can get mouse coordinates onmousemove or onclick in screen space Tryit Editor v3.6 and set this coordinates for your gui element The Babylon GUI | Babylon.js Documentation

2 Likes

Seems that this Playground could answer your question (see mouse coords in the console) - Babylon.js Playground

1 Like

So I myself am trying to make this demo because I think it would be cool to have around, this is what I have so far.

https://playground.babylonjs.com/#XCPP9Y#4713

Notice however that pointerX,Y 0 is the top left corner, while (0,0) on GUI is the middle of the screen. Still working on fixing.

1 Like

There all nice :slight_smile:

https://playground.babylonjs.com/#XCPP9Y#4718

7 Likes