Robotlegs support Starling framework.

rodrigopandini's Avatar

rodrigopandini

29 Sep, 2011 11:01 PM

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...

  1. Support Staff 1 Posted by Till Schneidere... on 12 Oct, 2011 10:35 AM

    Till Schneidereit's Avatar

    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. 2 Posted by Stray on 12 Oct, 2011 10:41 AM

    Stray's Avatar

    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

  3. Support Staff 3 Posted by Till Schneidere... on 12 Oct, 2011 10:43 AM

    Till Schneidereit's Avatar

    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. 4 Posted by Michal Wroblews... on 13 Oct, 2011 07:35 AM

    Michal Wroblewski's Avatar
  5. 5 Posted by rodrigopandini on 13 Oct, 2011 06:10 PM

    rodrigopandini's Avatar

    Great.
    I will fork and start test.
    Regards

  6. rodrigopandini closed this discussion on 13 Oct, 2011 06:10 PM.

  7. nadnerb re-opened this discussion on 17 Oct, 2011 06:47 AM

  8. 6 Posted by nadnerb on 17 Oct, 2011 06:47 AM

    nadnerb's Avatar

    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?

  9. 7 Posted by nadnerb on 17 Oct, 2011 07:13 AM

    nadnerb's Avatar

    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.

  10. 8 Posted by omar on 17 Oct, 2011 08:16 PM

    omar's Avatar

    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

  11. 9 Posted by dimas on 19 Oct, 2011 10:54 AM

    dimas's Avatar

    i have the same problem with nadnerb .. the mediator onregister event never get called..

  12. 10 Posted by Nadnerb on 19 Oct, 2011 02:35 PM

    Nadnerb's Avatar

    I solved it, the class packages were getting confused.
    See the comments here

    http://omar.likesflex.com/?p=54#comments

  13. 11 Posted by dimas on 20 Oct, 2011 05:45 AM

    dimas's Avatar

    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?

  14. 12 Posted by Christoph on 20 Oct, 2011 02:05 PM

    Christoph's Avatar

    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. :-(

  15. 13 Posted by omar on 21 Oct, 2011 05:31 PM

    omar's Avatar

    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

  16. 14 Posted by rodrigopandini on 27 Oct, 2011 05:44 PM

    rodrigopandini's Avatar

    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 to bubbles = true; and every thing works fine now. The second view mediator is created and onRegister and onRemove 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 the clone function. Maybe is because this that the second view is not created?

    Regards

  17. 15 Posted by bitelz on 09 Aug, 2012 07:40 AM

    bitelz's Avatar

    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

  18. 16 Posted by bitelz on 09 Aug, 2012 07:53 AM

    bitelz's Avatar

    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!

  19. Ondina D.F. closed this discussion on 27 Aug, 2012 10:38 AM.

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