New router

I tryed defold router but i don’t like how it works.So i implement my own library with the same idea.For now it contains less functions then defold router.
The main differences:

  • use msg.post() to change scene instead of lua module.
  • logs to console when changing scene
  • no save states(I think if scene need save state, scene should do it by itself)
  • no popup/input(will be added later)
7 Likes

Cool! Thank you for sharing!

2 Likes

It’s great that my library inspires other people to do something similar. Routing/navigation is something that Defold lacks and some people struggle with implementing it.

Actually, with my library scene changes also happen with messages :slight_smile: Lua module just provides a convenient way to do it — no need to remember URLs, message names and parameters.

3 Likes

For me then main problem in your library that i need to have router_object, to change scene. So i can change scene only in scene controller. Also you send router_object by msg.post, so every receiver get copy of that object. And it is additional work of copy and serialization object, which can be avoid. :slight_smile:

2 Likes

I agree that there’s an unnecessary information passing in my lib and this issue will be addressed in the next release, thanks for noticing that :slight_smile:

2 Likes

thank you for sharing. This can be helpful.

1 Like

It is old project.And I do not support it. I recommend you use router,monarch, or write you own implementation

3 Likes