Robotlegs 2 - Away3D
I'm having issues having the mediator for an Away3D view to create.
I have them mapped:
But the mediator is not created even though I see the instance of the Away3DView on the stage.
For RL1 I saw a solution:
The reason stated being:
"by default Robotlegs automatically creates the Mediator when the View dispatches Event.ADDED_TO_STAGE. Object3Ds don’t dispatch that, so you have to create the Mediator yourself"
Is this still the case with RL2?
Comments are currently closed for this discussion. You can start a new one.
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by Ondina D.F. on 23 Oct, 2015 11:39 AM
Robotlegs 2 works the same way as robotlegs 1 with regards to listening to added to stage events and creation of mediators.
The new feature in rl2 is the ViewProcessorMapExtension:
But, the issues encountered with away3d, starling, feather and the like remain: robotlegs can't handle 3DViews, either because, as you said, they don't dispatch added to stage events, or because the 3D stage doesn't have a display list ...
My suggestion is to use this extension for robotlegs 2, which works with away3d and starling:
Here are a few other extensions listed:
Let me know if using sars solved your issues.
2 Posted by Jono on 23 Oct, 2015 01:54 PM
Thanks for your reply.
I looked at https://github.com/jamieowen/robotlegs2-away3d-viewmap also and tried implementing it, but had no luck.
I am actually using SARS already, a slightly modified version so I could use the latest Starling. I've not yet had to use any Away3D in it, but now when I try I'm not having much success.
I re-created the SARS demo with these modifications to use the most recent components and put it here:
Can you suggest the steps I would follow to add an Away3D element with a Mediator in this example?
Support Staff 3 Posted by Ondina D.F. on 23 Oct, 2015 03:33 PM
No problem, Jono.
In the robotlegs.bender.example.sarsintegration.config.Config.as there is this:
Button3D is an away3d.containers.ObjectContainer3D and it implements IButton.
Thus a ButtonMediator will be created for a Button3D when it is added as a child to a view3D.scene.
The ButtonMediator has:
Does that not work for you?
4 Posted by Jono on 24 Oct, 2015 11:43 AM
Totally my bad - I dropped the ball on this one! When installing he SARS Bundle I forgot to pass the view3D (as previously I had no Away3D in this specific project) and then was attempting to add the Away3D instance an incorrect way also...
After passing the "root" view3D and [Inject]ing the correct one all is good.
Thanks for enlightening me : )
Jono closed this discussion on 24 Oct, 2015 11:43 AM.