ghostClass - Clicking on child objects

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

Posts: 86
Joined: 22 Sep 2009, 11:05

ghostClass - Clicking on child objects

Postby whornak » 09 Jan 2014, 00:46

I have a ghost class that contains several objects needing to receive the click event and have been unable to figure out how to do so.

I found: viewtopic.php?t=7204

Which states the following:

What is important is not the mouseEnabled property, but the mouseChildren: when an avatar is created, OpenSpace sets it mouseChildren property to false. Changing this value breaks the OpenSpace behavior.

So my question:

What functionality is negatively affected so that I can determine if that matters for me?
What alternative is there? I have tried hitTestPoint() and getObjectsUnderPoint() without success.

User avatar
Site Admin
Posts: 4535
Joined: 29 Mar 2005, 09:50
Location: Italy

Re: ghostClass - Clicking on child objects

Postby Bax » 09 Jan 2014, 15:28

There's a chance that enabling the mouseChildren property on the ghost only doesn't break the OpenSpace functioning.
Actually I'm not 100% sure and it is difficult to predict the behavior, so my suggestion is to test. If something breaks I suppose you won't be able to move the avatar around, or the AvatarEvents are not fired.
The reason why it might work is that the warning in the post you linked was about the actual avatar, not the ghost. In fact they are two separate objects and the OpenSpace engine must set the avatar.mouseChildren to false otherwise it wouldn't be able to recognize that an avatar was clicked and fire the appropriate events. But the ghost is something different, because it is a sort of separate object with a click listener used to bring it to front.
I suggest to give it a try and report your findings here.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 8 guests