Forum Discussion
5 Replies
- xoceunderRoku Guruthis 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 - xoceunderRoku Guruplease help
- NB_Roku GuruMy 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.
- xoceunderRoku Guru
"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 - destrukStreaming StarAs 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