Hi there,
I have a problem that looks like a bug in BABYLON.GUI to me but I’m posting it in Questions for now as maybe it’s intended behaviour and there is a way around the problem.
I have some code that changes cursor in various situations, using code like that:
engine.getRenderingCanvas().style.cursor = “url(’…/images/some_cursor_image.png’) 12 12, auto”;
I have scene.doNotHandleCursors set to true and it all worked perfectly fine until I added this code at some point in my application:
BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(“UI”);
Now, the change of the cursor happens for an extremely brief moment but any time mouse moves, the cursor is changed back to default.
It looks that the culprit is this code:
this._changeCursor("");
in babylonjs.gui.js that seems to be called on every pointer move.
I think this code should be enclosed in
if (!scene.doNotHandleCursors) clause, as it’s done in other places.
I can’t see an easy way around the problem, an obvious solution would be to change cursor every frame, after ADT does it but that seems very inefficient (particularly as cursor image is a png that needs to be loaded, I’m pretty sure browsers cache it but still).
Any ideas how to get around the problem? Or is it a bug and I should just report it as a bug?
Thanks
Jacek