dacian_roman23
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2015
12:14 AM
Re: Beta Scene Graph Components
I'm in a row list screen, and I have 3 row list elements. When i select one of them, i create a new scene that extends the task node that will download and parse a xml file. I am able to create a new screen , create my scene, but when i try to append any content to my scene, roku freezes, the telnet connection is lost, and then roku restarts itself . Suppose for the purpose of this example that when i select first element from the row i want to insert a rectangle such as <Rectangle id="middleRectangle" color="0xFFFFFF" width="50" height="50" translation="[250,225]"/> or when i select the second element i want to insert something as a label
function createContentTest(xml) as void
contentNode = createObject("roSGNode","ContentNode")
for each elem in xml
print elem.getName()
child = contentNode.createChild(elem.getName())
child.setFields(elem.getAttributes())
end for
screen = createObject("roSGScreen")
port = createObject("roMessagePort")
screen.setMessagePort(port)
scene = screen.createScene("seletedItemScene")
scene.appendChild(contentNode)
end function
####### selectedItemScene ####
<?xml version="1.0" encoding="utf-8" ?>
<component name="seletedItemScene" extends="Scene">
<children>
<Label text="aaa" translation="[0,0]" />
</children>
</component>
function createContentTest(xml) as void
contentNode = createObject("roSGNode","ContentNode")
for each elem in xml
print elem.getName()
child = contentNode.createChild(elem.getName())
child.setFields(elem.getAttributes())
end for
screen = createObject("roSGScreen")
port = createObject("roMessagePort")
screen.setMessagePort(port)
scene = screen.createScene("seletedItemScene")
scene.appendChild(contentNode)
end function
####### selectedItemScene ####
<?xml version="1.0" encoding="utf-8" ?>
<component name="seletedItemScene" extends="Scene">
<children>
<Label text="aaa" translation="[0,0]" />
</children>
</component>
dacian_roman23
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2015
02:46 AM
Re: Beta Scene Graph Components
I'm trying to create a "roArray" object in my scenegraph init function, and i get invalid as a result. It is not possible ? This component is not listed in Scene Graph BrightScript Support table.
maria_tarkany
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2015
01:20 AM
Re: Beta Scene Graph Components
Can we change the colour of the RowList cursor?
I've noticed by default it's bright white... but the client would like to have it on blue colour.
I've noticed by default it's bright white... but the client would like to have it on blue colour.
maria_tarkany
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015
01:08 AM
Re: Beta Scene Graph Components
How to set a field outside the xml file?
I want to send a value when I create a scene in main function:
I have this xml with "FirstScene" Scene:
I want to send a value when I create a scene in main function:
sub Main()
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("FirstScene")
scene.url = "http://wallpaperswide.com/download/" 'HERE I want to send the url value
'in debugging mode scene.url or scene.top.url are both invalid here
screen.show()
end sub
I have this xml with "FirstScene" Scene:
<?xml version="1.0" encoding="utf-8" ?>
<component name="FirstScene" extends="Scene" >
<interface>
<field id="url" type="string"/>
</interface>
<script type="text/brightscript">
<![CDATA[
sub init()
m.ep1 = m.top.createChild("Poster")
m.ep1.uri = m.top.url 'HERE I want to use the url
'But when I debug the app, in terminal the m.top.url field has no value
m.ep1.width = "264"
m.ep1.height = "148"
m.ep1.translation = "[930,500]"
end sub
]]>
</script>
</component>
dacian_roman23
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015
02:43 AM
Re: Beta Scene Graph Components
Regarding what Maria said, a field from a component interface can be set only in the init function of that component or in other components init function ? Is there a way for setting a field like she is doing in the example ? If not, how can we solve this problem?
neptor
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015
03:37 PM
Re: Beta Scene Graph Components
this gona help to make videogames?

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2015
04:23 PM
Re: Beta Scene Graph Components
nope.
jul10
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2016
09:02 AM
Re: Beta Scene Graph Components
"maria_tarkany" wrote:
How to set a field outside the xml file?
I want to send a value when I create a scene in main function:sub Main()
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("FirstScene")
scene.url = "http://wallpaperswide.com/download/" 'HERE I want to send the url value
'in debugging mode scene.url or scene.top.url are both invalid here
screen.show()
end sub
I have this xml with "FirstScene" Scene:<?xml version="1.0" encoding="utf-8" ?>
<component name="FirstScene" extends="Scene" >
<interface>
<field id="url" type="string"/>
</interface>
<script type="text/brightscript">
<![CDATA[
sub init()
m.ep1 = m.top.createChild("Poster")
m.ep1.uri = m.top.url 'HERE I want to use the url
'But when I debug the app, in terminal the m.top.url field has no value
m.ep1.width = "264"
m.ep1.height = "148"
m.ep1.translation = "[930,500]"
end sub
]]>
</script>
</component>
In order to make this work you'll need to have an observer set up on the 'url' field in your scene.
So your init() in your FirstScene would look like this:
sub init()
m.ep1 = m.top.createChild("Poster")
m.ep1.width = "264"
m.ep1.height = "148"
m.ep1.translation = "[930,500]"
m.top.observeField("url", "onUrlChanged")
end sub
sub onUrlChanged()
m.ep1.uri = m.top.url
end sub
The rest should remain unchanged.
Edit: Actually, you also need to assign the scene variables after calling screen.show() in your main()
sudo97
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2016
04:14 PM
Re: Beta Scene Graph Components
Hello, in roVideoScreen or roVideoPlayer we had maxBandwidth field and Streams field, so we could tune onto stream with quality we want. But in Scene Graph when I create the same thing:
I recieve a "failed to create media player", so my question is how can I do the same things in Scene Graph as I used to do with roVideoPlayer, using maxBandwidth?
m.video = m.top.FindNode("VideoPlayer")
videoContent = CreateObject("roSGNode", "ContentNode")
videoContent.Streams = [{
url: "link1",
bitrate: 1975,
quality: false,
contentid: "aaa"},
{
url: "link2",
bitrate: 921,
quality: false,
contentid: "bbb"}]
m.video.content = videoContent
m.video.ObserveField("errorMsg", "Error")
m.video.control = "play"
end sub
sub Error()
print m.video.errorMsg
end sub
I recieve a "failed to create media player", so my question is how can I do the same things in Scene Graph as I used to do with roVideoPlayer, using maxBandwidth?
aloudmind
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2016
11:23 AM
Re: Beta Scene Graph Components
Is there a way to have http://sdkdocs.roku.com/display/sdkdoc/RowList scroll up and down as opposed to left and right?