I am not sure creating >1 scene is a good idea in RSG. I’d feel better if i see scene transitions API (i.e. how to replace one scene with another, animations etc) - but i dont find that.
What is the reason to wish for >1 scene? Why not just use multiple “subscenes” (ok, so just a Group nodes) under a “One Scene to Rule them All”? https://sdkdocs.roku.com/display/sdkdoc/Scene as such has rather un-interesting features.
I agree with EnTerr. All of my SG channels have one “Controller” node extending Scene. It’s lifespan is the duration of the app. It creates and destroys “Screens” which extend “Group”
I had one Scene per controller only because it seems more organised. I come from a developer background in iOS and i guess i was trying to have a paradigm similar to each view controller having a view that gets shown/dismissed.
I understand from your replies this is the wrong approach, and i had suspected as much. Thank you for confirming.
So usually you just create one scene and remove nodes manually before inserting others. Can you share some sample code?
“juantwc” wrote:
I understand from your replies this is the wrong approach, and i had suspected as much. Thank you for confirming.
So usually you just create one scene and remove nodes manually before inserting others. Can you share some sample code?
I don’t know for a fact that multiple scenes are the wrong approach - just suspicion. If i learn more, i’ll let you know.
I imagine you can also hide/unhide whole Group trees - whether usable would depend on the real life performance though
I got a chance to ask someone privy to RSG’s mysteries and here is what i heard back:
“Scenography Swami” wrote:
Our recommended usage pattern is to create one RoSGScreen and one Scene node for a channel. You can treat the child nodes of the Scene (or one of its children) as different “views” and add transitions between them (e.g. crossfades, slides, etc.). This provides the same functionality as multiple Scene’s, just a different implementation.
I don’t think there is anything to prevent you from using multiple RoSGScreen’s but setting things up that way might fail to take advantage of future improvements to channel launching transitions, etc.