Dad72 Posted June 20, 2016 Share Posted June 20, 2016 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 => ) instead of the default hand => . 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. eboo and dbawel 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 20, 2016 Share Posted June 20, 2016 Hello, I guess (but not sure) this could be done at JS level. Then you just need to handle pointer events from scene to change it when you want Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 20, 2016 Author Share Posted June 20, 2016 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 20, 2016 Share Posted June 20, 2016 ok gotcha I will add a property to change it eboo 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 20, 2016 Author Share Posted June 20, 2016 Cool, thanks Deltakosh Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 21, 2016 Share Posted June 21, 2016 Done..now you can set scene.hoverCursor = " url('Images/viseur.png') 12 12, auto " (It is "pointer" by default) Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 21, 2016 Author Share Posted June 21, 2016 Thanks DK, this work Kemal UÇAR 1 Quote Link to comment Share on other sites More sharing options...
Kemal UÇAR Posted October 11, 2016 Share Posted October 11, 2016 Thanks for that new PG http://www.babylonjs-playground.com/#21YCLG#5 Dad72 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.