Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Mouse Over 2D Object

areibma
Registered User
Quote
2018-03-03 10:57:24

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?


erik
Registered User
Quote
2018-03-04 07:00:33

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?


areibma
Registered User
Quote
2018-03-04 07:09:07

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


just_in_case
Moderator
Quote
2018-03-04 07:37:50

there is already a built in behavior which does the same .... when cursor moved over do something maybe that might help you...



areibma
Registered User
Quote
2018-03-04 08:53:38

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


just_in_case
Moderator
Quote
2018-03-05 05:39:19

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


areibma
Registered User
Quote
2018-03-05 13:04:47

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.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact