Feathers overlapping Away3D: mouse issue

Software: Away3D 4.x

Hector, Sr. Member
Posted: 17 February 2016 07:39 PM   Total Posts: 137

My Away3D scene has Feathers controls on top. When clicking on some Feathers buttons, Away3D objects also catch the click events.
On several posts, this solution (or similar) is offered:

if (starling.stage.hitTest( new Point(stage.mouseXstage.mouseY), true is starling.display.Stage{
  
// Away3D code here.

This implies a lot of extra code on every Away3D mouse event handler or changing the Mouse3DManager.as class.

None of the options seems nice to me. Is there a correct way to solve this?

   

Hector, Sr. Member
Posted: 18 February 2016 06:43 PM   Total Posts: 137   [ # 1 ]

I’ve found this post in Feathers’ forum where they suggest using a transparent native Sprite to cover the Feathers button and stop Away3D from catching the mouse click.
A basic test on PC works, but also it is not a ‘clean’ solution and if the stage is resized you have to update the sprite according to the Starling controls. Not sure about compatibility with mobile screens.

It would be good if Away3D offers some Starling compatibility or vice versa.

Does anybody have a different approach?

   

rdoi, Member
Posted: 19 February 2016 02:04 PM   Total Posts: 86   [ # 2 ]

Well, I believe the approach in your previous post is the way.

Considering that the Away is in back, it has to be rendered first, and then it will fire mouse/touch events first.

So you have to intercept away event workflow adding some Starling hittest manually.

You can do it globally by editing the Mouse3DManager/TouchManager directly, or by replacing the default RaycastPicker both uses. Just add a conditional for starling stage hit in .getViewCollision(), before it traverses the scene.

 

   

Hector, Sr. Member
Posted: 22 February 2016 11:44 AM   Total Posts: 137   [ # 3 ]

Yes, it seems there’s no other choice.

I hate making changes to libraries because it’s a pain to update them later.  As both frameworks have maturity of several years and even have an ‘integration tutorial’ to make them work together, it’s perplexing that this problem hasn’t been addressed yet.

Anyway, thanks for your help.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X