Robotlegs support Starling framework.
Hi guys,
I would like know if the Robotlegs can support Starling
framework?
Someone know an utility class or library that cover this?
I'm planning create a project here and I will use Robotlegs and
also planning try use Starling framework to optimize the Views by
using renderization over GPU.
I will make a UIView that extends from starling.display.Sprite (no
from flash.display.Sprite) and would like mediate this with
UIMediator.
starling.display.Sprite extends from DisplayObjectContainer ->
DisplayObject -> EventDispatcher -> Object
I believe that Robotlegs will create the mediator, because my
UIView (starling.display.Sprite) will dispatches the event
"addedToStage", but in onRegister() function in UIMediator I can't
make the mediator listen from events of the UIView because the
first param need be an flash.events.IEventDispacher (and my UIView
is actually an starling.events.EventDispatcher).
So, I'm thinking in try create my own interface IEventMap and
modify the mapListener method to accept
starling.events.EventDispatcher not flash.event.IEventDispatcher,
but I'm not sure with I will can do this and if I will have
problems with incompatibilities.
It's possible? Any suggestion?
Regards,
http://www.starling-framework.org/
http://doc.starling-framework.org/core/
http://www.adobe.com/devnet/flashplayer/articles/introducing_Starli...
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Till Schneidere... on 12 Oct, 2011 10:35 AM
Have you tried to really mediate a Starling sprite? From a quick look
into their API docs, it looks like the addedToStage event is
sufficiently different from what the normal display list uses to make
it unusable by the current MediatorMap in Robotlegs. If it works, I'd
be surprised - delightfully so, of course.
Other than that, you can simply listen to the events directly instead
of using the eventMap. That is just a convenience class to make
automatic listener removal in mediator cleanup possible.
If the MediatorMap is it is currently turns out not to work with
Starling, some probably small changes to it will have to be made. I
won't immediately be able to look into it, though, so if you (or
somebody else) wants to look into it, we'd gladly accept (tested) pull
2 Posted by Stray on 12 Oct, 2011 10:41 AM
I think s9tpepper on Twitter announced yesterday that he's working on / completed an adaptation of RL that works with Starling - but I've no idea really what that means :)
hth,
Stray
Support Staff 3 Posted by Till Schneidere... on 12 Oct, 2011 10:43 AM
Ah, cool. I think the required changes are pretty small, but that's
only from a very cursory glance at the API docs, really.
4 Posted by Michal Wroblews... on 13 Oct, 2011 07:35 AM
Exactly, here's the link: https://github.com/s9tpepper/robotlegs-starling-plugin
5 Posted by rodrigopandini on 13 Oct, 2011 06:10 PM
Great.
I will fork and start test.
Regards
rodrigopandini closed this discussion on 13 Oct, 2011 06:10 PM.
nadnerb re-opened this discussion on 17 Oct, 2011 06:47 AM
6 Posted by nadnerb on 17 Oct, 2011 06:47 AM
I'm trying to implement these robotlegs starling classes, and running into trouble. My mediators that extend StarlingMediator aren't registering when their views are added to the stage. I have the main game view mediated, and that one IS registering, when I invoke new Starling(Game, stage).... but none of the others are. I set it up almost exactly the way the example is on that github page ^. Anyone else run into this?
7 Posted by nadnerb on 17 Oct, 2011 07:13 AM
And actually, when I run the example on that github page, "SecondViewMediator.onRegister()" never traces. Same problem. So maybe it's a configuration thing on my end? Not sure what I could be doing wrong.
8 Posted by omar on 17 Oct, 2011 08:16 PM
Hey nadnerb,
Do you have an .fxp file you can send me with your test so I can look at it? I did test mediating Sprites other than the main one, so I believe it should be working properly. It would help if I can see your code. You can email me here: omar [at] laflash.org
9 Posted by dimas on 19 Oct, 2011 10:54 AM
i have the same problem with nadnerb .. the mediator onregister event never get called..
10 Posted by Nadnerb on 19 Oct, 2011 02:35 PM
I solved it, the class packages were getting confused.
See the comments here
http://omar.likesflex.com/?p=54#comments
11 Posted by dimas on 20 Oct, 2011 05:45 AM
thanks nadnerb.. okay i got it, the mediator works. but not all of them.. in the example project only the mygamemediator that works, but the second view doesn't.. is there anything wrong?
12 Posted by Christoph on 20 Oct, 2011 02:05 PM
Hi guys,
I have the same problem with the Example. The second view mediator is never created.
Haven't figured out, what's going wrong. :-(
13 Posted by omar on 21 Oct, 2011 05:31 PM
I made an update to the robotlegs-starling-plugin last night to add a command object that will work correctly with the Starling plugin classes. Some default injections in the default Command had to be updated. https://github.com/s9tpepper/robotlegs-starling-plugin
14 Posted by rodrigopandini on 27 Oct, 2011 05:44 PM
Hi,
Thank you Omar for the plugins classes. After have the same problems that the
Nardneb said, the second view mediator is never created, I modified the
Event
class in Starling framework tobubbles = true
; and every thing works fine now. The second view mediator is created andonRegister
andonRemove
funcions are call.I'm not sure if I will have some problem by this, but for now, work very well.
I notice that
Event
class in Starling don't have theclone
function. Maybe is because this that the second view is not created?Regards
15 Posted by bitelz on 09 Aug, 2012 07:40 AM
Hi,
I've got the same problem (with running the onRegister function of the secondView mediator), but solution with changing the bubbles to true in starling.events.Event class isn't helping.
After that I have issue with line "super.dispatchEvent(event)" in starling.display.DisplayObject class.
Any suggestions or ideas would be appreciated.
Sorry for rehashing an pretty old topic.
Regards
16 Posted by bitelz on 09 Aug, 2012 07:53 AM
I figured It out.
For the sake of future lost people looking for solution:
It's important to set autoStartup = true in constructor of context class!
Ondina D.F. closed this discussion on 27 Aug, 2012 10:38 AM.