Jump to content

Pointer type personalized for the actions


Recommended Posts

Hello guys,

I would use a pointer customized for the actions when the cursor is over on the object. I would use a viewfinder cursor (a PNG image => viseur.png) instead of the default hand => cursor-pointer.png.

Is it possible to do or what it might be something that can be added to BABYLON. I think for a game it can be interesting to changed the cursors by defaut. :)

Thanks in advance.

Link to comment
Share on other sites

I do not manage to change the cursor. Babylon causes the default cursor.

I try to do this and the cursor does not change:

mesh.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger, function() {
            canvas.style.cursor = "url('Images/viseur.png') 12 12, auto";

When I look in the file babylon.scene.js I see this: (line 582 to 587)

if (_this._pointerOverMesh.actionManager && _this._pointerOverMesh.actionManager.hasPointerTriggers) {
       canvas.style.cursor = "pointer";
else {
       canvas.style.cursor = "";

There not have the ability to change this slider with a parameter in the engine, because manually, as soon as one is on an object, the mouse cursor takes the default mandatory.

Link to comment
Share on other sites

  • 3 months later...

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...