Your Digital Media Has Never Looked So Good

 
neptor
Posts: 13
Joined: Wed Apr 15, 2015 8:25 am
Location: Mexico
Contact:

Re: Beta Scene Graph Components

Tue Dec 22, 2015 4:37 pm

this gona help to make videogames?
 
User avatar
Komag
Posts: 808
Joined: Fri Aug 22, 2014 3:42 am

Re: Beta Scene Graph Components

Wed Dec 23, 2015 5:23 pm

nope.
 
jul10
Posts: 3
Joined: Thu Oct 01, 2015 5:41 am

Re: Beta Scene Graph Components

Tue Jan 05, 2016 10:02 am

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()
Last edited by jul10 on Mon Jan 18, 2016 8:43 am, edited 1 time in total.
 
sudo97
Posts: 46
Joined: Wed Sep 16, 2015 8:43 am

Re: Beta Scene Graph Components

Thu Jan 07, 2016 5:14 pm

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:
         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
Posts: 2
Joined: Thu Jan 14, 2016 12:13 pm

Re: Beta Scene Graph Components

Thu Jan 14, 2016 12:23 pm

Is there a way to have http://sdkdocs.roku.com/display/sdkdoc/RowList scroll up and down as opposed to left and right?
 
bosborne
Posts: 141
Joined: Wed Jun 06, 2012 10:42 am

Re: Beta Scene Graph Components

Sun Jan 17, 2016 2:47 pm

jul10 wrote:
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.


I'm unable to get this working as well.

Here's a simple example. I want to pass in an roAssociativeArray of categories into the scene (and into the row list). Here's the code for my scene... "hello" is never even printed.

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

<component name="SimpleRowListScene" extends="Scene" >

<interface>
  <field id="categories" type="assocarray" onChange="categoriesChanged"/>
</interface>

<script type="text/brightscript" >
<![CDATA[
function init()
    print "in init"
    m.theRowList = m.top.FindNode("theRowList")
    m.theRowList.SetFocus(true)
end function

function categoriesChanged() as void
    print "hello"
    m.top.theRowList.categories = m.top.categories
end function
]]>
</script>

<children>
    <SimpleRowList id="theRowList" translation="[50,50]" />
</children>
</component>


My brightscript main code:

    categories = getCategoryAssociateArrayData()

    screen = CreateObject("roSGScreen")
    port = CreateObject("roMessagePort")
    screen.setMessagePort(port)
    scene = screen.CreateScene("SimpleRowListScene")
    scene.categories = categories
    screen.show()

    while(true)
        msg = wait(0, port)
        msgType = type(msg)
        if msgType = "roSGScreenEvent"
            if msg.isScreenClosed()
                return true
            end if
        end if
    end while
 
bosborne
Posts: 141
Joined: Wed Jun 06, 2012 10:42 am

Re: Beta Scene Graph Components

Sun Jan 17, 2016 4:10 pm

I am also curious how one would secure video with the new video component? A couple other users asked this as well but it hasn't been answered yet.

It would also be great to get a basic "full app" tutorial up that uses multiple scenes together as another user suggested
 
helloworld++
Posts: 1
Joined: Mon Jan 18, 2016 12:14 am

Re: Beta Scene Graph Components

Mon Jan 18, 2016 12:36 am

Will RightToLeft (RTL) text direction be supported in rendered nodes that have a text field? -- The roImageCanvas does a good job of it. -- Currently if you set the Label's text field to an RTL string, the characters are shown in the wrong order and disjointed.

The SDK document says that the Label node supports Justification, but setting it in horizAlign doesn't work?

Any possibility of given all Scene Graph nodes that show text, including the widgets, the ability to set their own font, text direction, justification (in cases where it makes sense), character Kerning, character spacing, and to get the justification character?

For ref: https://msdn.microsoft.com/en-us/library/windows/desktop/hh994452(v=vs.85).aspx


Any possibility of given the ability to change the default font for an entire Scene? and an entire node (including its children)? and for a specific node (even when it's a child)?
 
jul10
Posts: 3
Joined: Thu Oct 01, 2015 5:41 am

Re: Beta Scene Graph Components

Mon Jan 18, 2016 8:19 am

bosborne wrote:
jul10 wrote:

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.


I'm unable to get this working as well.

Here's a simple example. I want to pass in an roAssociativeArray of categories into the scene (and into the row list). Here's the code for my scene... "hello" is never even printed.

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

<component name="SimpleRowListScene" extends="Scene" >

<interface>
  <field id="categories" type="assocarray" onChange="categoriesChanged"/>
</interface>

<script type="text/brightscript" >
<![CDATA[
function init()
    print "in init"
    m.theRowList = m.top.FindNode("theRowList")
    m.theRowList.SetFocus(true)
end function

function categoriesChanged() as void
    print "hello"
    m.top.theRowList.categories = m.top.categories
end function
]]>
</script>

<children>
    <SimpleRowList id="theRowList" translation="[50,50]" />
</children>
</component>


My brightscript main code:

    categories = getCategoryAssociateArrayData()

    screen = CreateObject("roSGScreen")
    port = CreateObject("roMessagePort")
    screen.setMessagePort(port)
    scene = screen.CreateScene("SimpleRowListScene")
    scene.categories = categories
    screen.show()

    while(true)
        msg = wait(0, port)
        msgType = type(msg)
        if msgType = "roSGScreenEvent"
            if msg.isScreenClosed()
                return true
            end if
        end if
    end while


Forgot to mention this in my first reply, but you also need to assign the scene variables after calling screen.show().
So, in your case:

    categories = getCategoryAssociateArrayData()

    screen = CreateObject("roSGScreen")
    port = CreateObject("roMessagePort")
    screen.setMessagePort(port)
    scene = screen.CreateScene("SimpleRowListScene")
    screen.show()
    scene.categories = categories

    while(true)
        msg = wait(0, port)
        msgType = type(msg)
        if msgType = "roSGScreenEvent"
            if msg.isScreenClosed()
                return true
            end if
        end if
    end while


This should work.
 
bosborne
Posts: 141
Joined: Wed Jun 06, 2012 10:42 am

Re: Beta Scene Graph Components

Mon Jan 18, 2016 5:22 pm

I tried that yesterday as well, after I stumbled upon something in the docs that mentioned that. But it still did not trigger my field observer in the component.
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Beta Scene Graph Components

Tue Jan 19, 2016 1:02 am

bosborne wrote:
Here's a simple example. I want to pass in an roAssociativeArray of categories into the scene (and into the row list). Here's the code for my scene... "hello" is never even printed.

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

<component name="SimpleRowListScene" extends="Scene" >

<interface>
  <field id="categories" type="assocarray" onChange="categoriesChanged"/>
</interface>

<script type="text/brightscript" >
<![CDATA[
function init()
    print "in init"
    m.theRowList = m.top.FindNode("theRowList")
    m.theRowList.SetFocus(true)
end function

function categoriesChanged() as void
    print "hello"
    m.top.theRowList.categories = m.top.categories
end function
]]>
</script>

<children>
    <SimpleRowList id="theRowList" translation="[50,50]" />
</children>
</component>

I don't know if this is the cause of your problem (probably not, if you're not seeing the "hello"), but "m.top.theRowList.categories = m.top.categories" should be "m.theRowList.categories = m.top.categories".
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
dacian_roman23
Posts: 40
Joined: Wed Dec 09, 2015 3:24 am

Re: Beta Scene Graph Components

Fri Jan 22, 2016 7:56 am

How do I add subtitles in a scene graph Video Node ? I have tried setting the subtitleTrack field and also the fields in the meta data but with no luck . For a hls video what should i set to this subtitleTrack or in the meta-data fields? There's nothing in the documentation for the video node and the subtitle .
 
sudo97
Posts: 46
Joined: Wed Sep 16, 2015 8:43 am

Re: Beta Scene Graph Components

Fri Jan 22, 2016 1:49 pm

What about using two Video nodes on one scene? You have written it's impossible to switch between two scenes, so I created two Group nodes and each of them contains imitation of scene, and both have Video node, so that causes strange behaviour.
 
User avatar
RokuRobB
Posts: 85
Joined: Tue Jul 10, 2012 3:07 pm

Re: Beta Scene Graph Components

Sat Jan 30, 2016 1:34 pm

Closed caption integration in scene graph is similar to the legacy SDK. You set up the subtitleconfig content attribute as shown in the SceneGraphCaptionsDemo.zip sample found here: http://sdkdocs.roku.com/display/sdkdoc/Playing+Videos.
 
User avatar
RokuRobB
Posts: 85
Joined: Tue Jul 10, 2012 3:07 pm

Re: Beta Scene Graph Components

Sat Jan 30, 2016 1:36 pm

Using two video nodes to stream at the same time is not supported. This is similar to the fact that only one roVideoScreen or roVideoPlayer can stream content at a time.

Who is online

Users browsing this forum: No registered users and 6 guests