brybott
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2016
02:43 PM
setting background color field on scene graph scene nodes
So, I'm creating a component that extends scene and using it and passing it to roSGScreen. Scene nodes have a backgroundColor field as well as a backgroundUri field. I see in the VOD Banner example, you can set the backgroundUri. But I can't set a backgroundColor.
The documentation (see link below) says that the backgroundColor field takes a color which should be a "color type". Doing something like:
m.top.backgroundColor = "0xFF0000FF"
in the script section of the scene component does not give any result. Is this expected behavior? A bug? Am I doing something wrong? How can I set the background color of the scene?
(I know I can create a rectangle node the size of the screen and set it as a background layer, but I think it would be preferable to set the background color of the scene directly).
https://sdkdocs.roku.com/pages/viewpage ... Id=1608549
The documentation (see link below) says that the backgroundColor field takes a color which should be a "color type". Doing something like:
m.top.backgroundColor = "0xFF0000FF"
in the script section of the scene component does not give any result. Is this expected behavior? A bug? Am I doing something wrong? How can I set the background color of the scene?
(I know I can create a rectangle node the size of the screen and set it as a background layer, but I think it would be preferable to set the background color of the scene directly).
https://sdkdocs.roku.com/pages/viewpage ... Id=1608549
4 REPLIES 4

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2016
05:04 PM
Re: setting background color field on scene graph scene node
In the init function
Try explicitly setting the m.Top.backgroundURI = "" first
Then set the color m.Top.backgroundColor = &hFFFFFFFF
This Scene Graph is more convoluted then the 2D
That's how I got it to work. But you should not have to spend hours on every step in the process trying to figure out why nothing works as expected. Even though I believe The last time I read it that uri has precedent and there is a default value - could be wrong. So if that was/is the case then you need to set it to an empty string first before the color value is looked at.
Try explicitly setting the m.Top.backgroundURI = "" first
Then set the color m.Top.backgroundColor = &hFFFFFFFF
This Scene Graph is more convoluted then the 2D
That's how I got it to work. But you should not have to spend hours on every step in the process trying to figure out why nothing works as expected. Even though I believe The last time I read it that uri has precedent and there is a default value - could be wrong. So if that was/is the case then you need to set it to an empty string first before the color value is looked at.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2016
10:08 AM
Re: setting background color field on scene graph scene node
"NewManLiving" wrote:
In the init function
Try explicitly setting the m.Top.backgroundURI = "" first
Then set the color m.Top.backgroundColor = &hFFFFFFFF
That's correct. The backgroundColor only works if you clear the backgroundURI first. I'm not sure if that's by design or not, but it took me awhile to figure it out, too.
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
brybott
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2016
10:45 AM
Re: setting background color field on scene graph scene node
Thanks folks for the response. The weird part is, when I was trying it, I didn't even have a backgroundUri set up, so the field should have defaulted to invalid, as it says in the documentation. It's strange that in order for backgroundColor to work, backgroundUri has to be set specifically to an empty string.
TAC
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2018
03:10 AM
Re: setting background color field on scene graph scene nodes
Thank you folks. Struggled with this forever.
Not only should it default, it appears to do just that because if you print it to the console (between two text strings), it prints just as an empty string should.
Not only should it default, it appears to do just that because if you print it to the console (between two text strings), it prints just as an empty string should.