tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/11683-mediate-starling-and-displaylist-sprites-on-the-same-contextRobotlegs: Discussion 2014-08-26T13:36:34Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/342676902014-08-26T11:59:03Z2014-08-26T11:59:03ZMediate Starling- AND DisplayList-Sprites on the same context?<div><p>Hi Gustavo,</p>
<p>Hmm, Starling's DisplayObjectContainer and Starling's
EventDispatcher are a pain in the ...code;) Besides, I'm not a
Starling expert. Anyway, I'll try to help you. Hopefully, others
will chime in as well.</p>
<p>Which Starling extension are you using?</p>
<p>If you're using jamieowen's extension, I think that all you have
to do is to let the Mediator for your non-Starling display object
extend a regular robotlegs
Mediator(robotlegs.bender.bundles.mvcs.Mediator), while the
mediator for your Starling component will extend a
StarlingMediator.</p>
<p>If you're using the SARS extension, you'll probably have to
mediate your non-starling components manually. You create a
mapping:</p>
<pre>
<code>mediatorMap.map(NonStarlingView).toMediator(NonStarlingMediator);</code>
</pre>
<p>Then, somewhere you create your view:</p>
<pre>
<code>var nonStarlingView: NonStarlingView = new NonStarlingView();
addChild(nonStarlingView);
mediatorMap.mediate(nonStarlingView);</code>
</pre>
<p>Of course, that's a bit uncomfortable, because you have to have
access to the mediatorMap in order to make it work. Maybe you can
let the mediator of the view that is adding the nonStarlingView
access an injected mediatorMap, even if it's not a very nice
solution.</p>
<p>Or, if you use the ViewProcessorMap to map your nonStarlingView,
you can do:<br>
viewProcessorMap.process(nonStarlingView);</p>
<p>If you need more help with this, try to explain your use case in
more detail, and also don't forget to mention which libraries
you're using.</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/342676902014-08-26T12:34:09Z2014-08-26T12:34:09ZMediate Starling- AND DisplayList-Sprites on the same context?<div><p>Hi Ondina,</p>
<p>Thanks for your answer.</p>
<p>I'm using SARS, or better said, a forked modified version of
SARS... Anyways... calling the mediation manually did the
trick!</p>
<p>I'm wondering if you are using another library other than SARS
for Away3D + Starling projects.</p>
<p>Thanks again</p>
<p>Gustavo</p></div>Gustavotag:robotlegs.tenderapp.com,2009-10-18:Comment/342676902014-08-26T13:36:31Z2014-08-26T13:36:31ZMediate Starling- AND DisplayList-Sprites on the same context?<div><p>I'm glad that manual mediation worked for you!</p>
<p>I haven't been using Starling in my projects until now. That
might change in the future, though. I think SARS and jamieowen's
are the most popular Starling extensions.</p>
<p>Look for 'Starling' under:<br>
<a href=
"http://knowledge.robotlegs.org/discussions/examples/20-links-to-robotlegs-v2-articles-examples-demos-utilities-and-tutorials">
http://knowledge.robotlegs.org/discussions/examples/20-links-to-rob...</a></p>
<p>There are also a few examples.</p></div>Ondina D.F.