ttown253
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016
08:58 AM
Can I use the Scene Graph API for just one screen?
Hello,
I have an app that uses the roPosterScreen as my main menu and other legacy SDK screens for all others. I want to use the Scene Graph API's EPGGrid for just one screen in my app. I've got the grid working fine by itself, but when I close it and go back to the main menu, the app exits. I'm showing the EPGGrid using the standard method as described in the docs:
My main method shows the main menu and handles screen navigation just like on this page https://sdkdocs.roku.com/display/sdkdoc/Working+with+Screens right under the "Code Structure" title.
The problem is that when the scene graph screen is closed, instead of going back to the main menu, the whole app closes. After doing some debugging, it's also marking my main menu's roPosterScreen as "closed" even though it shouldn't be and the app is exiting prematurely. If I disable the check for "isScreenClosed()" on the main menu, the app will not exit, and the main menu is visible, but will no longer respond to key presses from the remote.
Is it possible to just use Scene Graph for one screen in a legacy app and have all the screens play nice?
I have an app that uses the roPosterScreen as my main menu and other legacy SDK screens for all others. I want to use the Scene Graph API's EPGGrid for just one screen in my app. I've got the grid working fine by itself, but when I close it and go back to the main menu, the app exits. I'm showing the EPGGrid using the standard method as described in the docs:
sub showEpgGrid()
screen = CreateObject("roSGScreen")
port = CreateObject("roMessagePort")
screen.setMessagePort(port)
scene = screen.CreateScene("rcgridscene")
screen.show()
while true
msg = wait(0, port)
if msg.isScreenClosed() then
return
end if
end while
end sub
My main method shows the main menu and handles screen navigation just like on this page https://sdkdocs.roku.com/display/sdkdoc/Working+with+Screens right under the "Code Structure" title.
The problem is that when the scene graph screen is closed, instead of going back to the main menu, the whole app closes. After doing some debugging, it's also marking my main menu's roPosterScreen as "closed" even though it shouldn't be and the app is exiting prematurely. If I disable the check for "isScreenClosed()" on the main menu, the app will not exit, and the main menu is visible, but will no longer respond to key presses from the remote.
Is it possible to just use Scene Graph for one screen in a legacy app and have all the screens play nice?
8 REPLIES 8

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016
10:10 AM
Re: Can I use the Scene Graph API for just one screen?
If you don't already have a screen open when your roSGScreen closes, then the app will exit. I would think you could just put up a facade screen:
- Joel
sub main()
bottomScreen=createobject("roimageCanvas")
bottomScreen.show()
showEpgGrid()
- Joel
ttown253
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016
10:38 AM
Re: Can I use the Scene Graph API for just one screen?
I already have an roPosterScreen open underneath the roSGScreen. I tried doing that trick as well, with a facade screen always open under everything, but it didn't help. It's almost like closing the roSGScreen is sending a kill signal to the app as a whole.

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016
10:42 AM
Re: Can I use the Scene Graph API for just one screen?
Ok. That is interesting. I'll talk to the SG team and see if this is intended behavior and if there is a work-around.
- Joel
- Joel
dlwcarr
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2016
12:15 PM
Re: Can I use the Scene Graph API for just one screen?
I'm having the same problem, where pressing the back button causes the whole app to exit rather than just closing the roSGScreen.
Joel, any updates from the SG team?
Joel, any updates from the SG team?
ttown253
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2016
09:39 AM
Re: Can I use the Scene Graph API for just one screen?
I was using some recursion hacks to get around this, but it appears that the latest 7.1 firmware released yesterday has fixed this issue.
jedashford
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2016
12:31 PM
Re: Can I use the Scene Graph API for just one screen?
Same problem here, but my Roku 4 is still on 7.0. Even if I got mine updated, I wouldn't be able to use this for our customers. If any single user is on 7.0, it would shut down the app when backing out of an roSGScreen. Any way to get around this with 7.0 or any hints on how to force an upgrade of my roku and our customers rokus?
jedashford
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2016
12:59 PM
Re: Can I use the Scene Graph API for just one screen?
This seems like a pretty serious bug for anyone with a hybrid app. If there is no work around, I probably should stop dev now and wait a few months/year until 7.0 is flushed out of all Roku's or we decide to rebuild the app in the Scene Graph API. Anyone figure out a solution?
jedashford
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2016
03:28 PM
Re: Can I use the Scene Graph API for just one screen?
Well after alot of trial and error, looks like Joel was right, as usual 🙂
I was using an roPosterScreen as a facade, but apparently this doesn't work with the Scene Graph API, you'll need to use the roimageCanvas.
This does work and wont kill your channel:
I was using an roPosterScreen as a facade, but apparently this doesn't work with the Scene Graph API, you'll need to use the roimageCanvas.
This does work and wont kill your channel:
facade = createobject("roimageCanvas")
facade.show()