Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
xoceunder
Level 7

How to open multiple scenegraph

How can i make a menu to enter different scenegraph
0 Kudos
5 Replies
xoceunder
Level 7

Re: Could you help me with my code

this code

<?xml version = "1.0" encoding = "utf-8" ?>

<!--********** Copyright 2016 Roku Corp.  All Rights Reserved. **********-->

<component name = "LabelListExample" extends = "Scene" initialFocus = "Buttons" >

  <script type = "text/brightscript" >

    <![CDATA[

    sub init()
      m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"

      example = m.top.findNode("Buttons")

      m.top.setFocus(true)
    end sub

   ' on Button press selected
   Sub onItemSelected()
    ' first button is Play
print "Boton "; m.top.itemSelected
    if m.top.itemSelected = 0
        'print "Second 1 "
else if m.top.itemSelected = 1
        'print "Second 2 "
    end if
   End Sub

    ]]>

  </script>
  
    <interface>
        <!-- Button press handler -->
        <field id="itemSelected" type="integer" alwaysnotify="true" alias="Buttons.itemSelected" onChange="onItemSelected" />
    </interface>

  <children >
  
     <LabelList
            id="Buttons"
focusRow = "0"
itemSize = "[440,48]"
            translation="[150,150]"
            color="0xFFFFFFFF"
            focusedColor="0x333333FF"
            numRows="5"
            sectionDividerHeight = "48.0"
            sectionDividerFont = "font:MediumBoldSystemFont"
            sectionDividerTextColor = "0x880088FF">

      <ContentNode role = "content" >
        <ContentNode title = "Menu 1"/>
        <ContentNode title = "Menu 2"/>
      </ContentNode>

    </LabelList>

  </children>

</component>



How can I make it to enter another scene
0 Kudos
xoceunder
Level 7

Re: How to open multiple scenegraph

please help
0 Kudos
Roku Employee
Roku Employee

Re: How to open multiple scenegraph

My understanding is that the easiest way to handle different "logical" scenes in the current implementation of RSG is not to create multiple custom components inheriting from Scene - but instead to have only 1 Scene and under it attach different non-scene components representing your different logical screens. You can either add/remove said screens from the scene or you can have them all attached but hide/show the "slide" that is currently needed by the app flow.
0 Kudos
xoceunder
Level 7

Re: How to open multiple scenegraph

"RokuNB" wrote:
My understanding is that the easiest way to handle different "logical" scenes in the current implementation of RSG is not to create multiple custom components inheriting from Scene - but instead to have only 1 Scene and under it attach different non-scene components representing your different logical screens. You can either add/remove said screens from the scene or you can have them all attached but hide/show the "slide" that is currently needed by the app flow.

Some example to see how to make this possible
0 Kudos
destruk
Level 10

Re: How to open multiple scenegraph

As the SDK states, you should only have a single extension of a single scene.  And it's probably too complex to have multiple scenes.  So just make one scene, and add other components to that, extending the components instead of the scene. (like RokuNB said)
Most of the sample apps are as simplistic as possible, but to explore how to create multiple scenes this is a decent sample - 
https://github.com/rokudev/videoplayer-channel
0 Kudos