Jump to content

Change cursor on hover GUI button


Recommended Posts


I have a problem with the change of cursor on a hover button.
On the PG I created two AdvancedDynamicTexture. First to create two buttons that display alternately. 
Their function is to display the labels associated with the meshes
The mouse pointer changes well on the labels of the meshes but not on the button on the bottom left.
And when I click to hide the labels then the mouse cursor changes to the button at the bottom left.


I think it's related to the layers of the advancedDynamicTexture, but I have no idea to solve the problem.

I need help.



Link to comment
Share on other sites


I'm working on two advancedDynamicTexture, one that is still active

and the second that I show or remove for to display or not the labels:

line 60 advancedTexture.dispose ();


if i work with a single advanceddynamictexture, i lose the action show / hide labels

Link to comment
Share on other sites

Thank you, I note for "note that the bold emphasis" .
I had read a while ago but as on the PG of demo http://playground.babylonjs.com/#DRCMQB#12, 
there are two full screen GUI line 40 and line 199 that are used so I tried.
But there is a second instruction that I do not understand line 200: advancedTexture.layer.layerMask = 2; 
Do you know its usefulness?


If I work with a single full screen I have to find another way to make the button show / hide labels.


I tried using the property isVisible but it does not work. An idea ?



Link to comment
Share on other sites

cool - i didn't know about the layerMask allowing more than 1!   if you get it working with layerMask, please share. thanks.

edit: problem in your PG was that button3 was not in scope.  see my PG to get access to the buttons you created.  you can use alpha or isVisible.


Link to comment
Share on other sites

Thanks for your help. 
montrerButtons cacherButtons in french ;-) !!
And in addition it allows me to understand why I did not access the properties of the buttons. 
I will not use layermask, but your solution that works very well and that I understand it.
It opens up a lot of possibilities.
again thank you 
Link to comment
Share on other sites

  • RaananW changed the title to Change cursor on hover GUI button

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...