Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 10

Re: Newbie Q: Understanding How to Bring Up New Screens

usually screens are visible by default and the way to bring them up is to create and attach them to the scene.
aspiring
0 Kudos
Highlighted
Level 7

Re: Newbie Q: Understanding How to Bring Up New Screens

Thanks for this info, Joe. Could you provide some additional info on the functions used?
0 Kudos
Highlighted
Level 10

Re: Newbie Q: Understanding How to Bring Up New Screens

In the example I'm looking at "Simple Grid and Video" it has HomeScene.xml that has child components such as "GridScreen", an overhang, "Video".
You can create a new screen like this

newscreen = createObject("roSGNode","MyScreenComponent")

(of course you would need an XML and accompanying brs that defines your custom component "MyScreenComponent" as a full screen component, maybe extending Group)
then if it's created elsewhere, you need to pass that screen node to the HomeScene through a new field defined in HomeScene.xml:
<field id="myScreenNode" type="node" alwaysnotify="true" onChange="newScreenSet"/>

 and have HomeScene append it as it's last child so it appears over top of anything on screen. in HomeScene.brs:
sub newScreenSet()
   newScreen = m.top.myScreenNode
   if newScreen <> invalid
       m.top.appendChild(newScreen)
   end if
end sub
aspiring
0 Kudos
Highlighted
Level 7

Re: Newbie Q: Understanding How to Bring Up New Screens

Awesome. Thanks, @joetesta.
0 Kudos