Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, Is there any methods in javascript to know that mouse cursor is over a 2D overlay? To avoid interaction with 3D object while I am clicking a button? |
||||
|
You can check the position of the cursor and compare it with the position of the 2D overlay. It's just a simple if, usually, isn't it? |
||||
|
Ya, I did that in my menu template, for that require a global variable to communicate. Just thought there might be built in method to do that, would become handy |
||||
|
there is already a built in behavior which does the same .... when cursor moved over do something maybe that might help you... |
||||
|
Yes, but I want to stick with javascript right now. It would have been very easy if we would be able to message or communicate between two scripts. I will go with my own method for now. Thank you |
||||
|
as @eric said check the mouse position and compare it with the position of 2d overlay.... or maybe you can use ccbGet2DPosFrom3DPos('cubemesh1") and then compare that position with the 2d overlay or with the mouse position... Cubemesh1 will be the 3d object whose interaction you want to avoid... |
||||
|
It is easy to check using the method "isMouseInside(x, y)" that I used in my simple menu button example. But the problem will come when someone will use a non rectangle gui. |
|