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: 
greubel
Level 7

SceneGraph Bug

Some text labels are not displayed.
I created a scroll-able list that fills the screen in a TASK and then in brightscript, I insert addition lines dynamically.
Everything looks good except the new lines label text is not rendered. Each line has 1 to four images with a text field.
The images are displayed but not the text. Only on the new lines.

Here is a partial structure.
*       type = Rectangle ID =  visible = true x 40 y 864 w 1880 h 96 clr 00000000
*         type = Group ID =  visible = true x 0 y 0
*           type = Label ID =  visible = true x 2 y 20 w 1787 h 96 clr 000000FF Text = Genre/Song
*           type = Label ID =  visible = true x 0 y 18 w 1787 h 96 clr 708091FF Text = Genre/Song
*         type = Poster ID =  visible = true x 53 y 36 w 48 h 48 url = tmp:/Theme/Default/off.png
*       type = Rectangle ID =  visible = true x 40 y 960 w 1880 h 96 clr 00000000
*         type = Group ID =  visible = true x 0 y 0
*           type = Label ID =  visible = true x 2 y 20 w 1787 h 96 clr 000000FF Text = Playlists
*           type = Label ID =  visible = true x 0 y 18 w 1787 h 96 clr 708091FF Text = Playlists
*         type = Poster ID =  visible = true x 53 y 36 w 48 h 48 url = tmp:/Theme/Default/off.png
0 Kudos
5 Replies
speechles
Level 7

Re: SceneGraph Bug

You cannot just modify the XML if you want dynamic changing elements. There must be an XML default then your BRS brightscript file has the control of changing this.

somewhere inside the XML:
<Label id="idMyLabel" height="40" width="200" text="Default Text" vertAlign="center" HorizAlign="center" />

in the init of the BRS file sourced in the above XML:
m.mylabel = findNode("idMyLabel")
m.mylabel.translation = [ X , Y ]

then inside the section of the BRS you want to change:
m.mylabel.text = "New text here"

Also make it easier on yourself. Use a <Group> to name your "Panel" (aka put the rectangle in it too) which is what I guess you are after with the music style names on things. Then use a <LayoutGroup> (to position the labels onto your rectangle) to position your things below. Doing this you don't need so many things to set visible or not. You just set the Group panel visible true or false and everything below follows. To move labels just change the translation of the layout group they are in with brightscript the same way I do with the label example above. This makes it far easier on you than you are doing right now.

If you post actual code you are using you could get better advice.
0 Kudos
greubel
Level 7

Re: SceneGraph Bug

None of this is in XML. it's all BrightScript.
0 Kudos
speechles
Level 7

Re: SceneGraph Bug

That must be painful. No XML/BRS just all scene graph written entirely in BRS.

I usually use a labellist instead of a label if i have a display like yours. Then just disable the focus indicator from appearing. It is easier to use a labellist with a layout group and keep everything aligned. Plus easier on translation placements and just all around easy.

Without knowing more of how you did this it may not be a Roku bug but your implementation causes it. If you leak outside your itemsize with labelllist you will get cut off or not display at all. It is hard to help when all you show are values within the nodes. I can tell you have the order wrong though. Your group should be around your rectangle then a layout group. Your layout group should be around your labels. This part makes it easier to align the translations. 

Any reason why you wrote it entirely in BRS with no XML at all? Can you share some of the BRS code you have without leaking your project? I could help you see if this is really a Roku bug if I knew how you implemented it.

BTW.. displayPartialLines.. Is that your issue? It will default to false should your label be true? what is your maxlines on the label? The double label is your shadow effect?
0 Kudos
squirreltown
Level 8

Re: SceneGraph Bug

"speechles" wrote:
Any reason why you wrote it entirely in BRS with no XML at all? 

I do primarily animation and don't use the xml at all for Scenegraph. If you are dynamically changing things constantly, it makes more sense. The XML is fine for putting something on screen that never changes, like a logo.
Kinetics Screensavers
0 Kudos
speechles
Level 7

Re: SceneGraph Bug

I can see animation being a reason. There is never a default possibly. The movement is not ordered. A game or perhaps a screen saver this would make sense.

But in an app with a UI it is useful to use the XML to create the default. Then add onto that in BRS to dynamically alter the default. The XML is much faster to build in than in pure BRS. The speed difference is noticeable in both development and execution of code.
0 Kudos