Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
supersecretuser
Level 7

Force kill of screen from stack

If was mentioned that there was a way force the removal of a screen from the stack. Apparently it hasn't made it into the documentation yet. Can someone from Roku let me know what the syntax is?
0 Kudos
6 REPLIES 6\
RokuKevin
Level 9

Re: Force kill of screen from stack

To remove a screen from the display stack, you would just call the Close() method on the screen:

Void Close()
Close the screen and delete the associated object. Useful for avoiding screen flicker when the display order of your screens does not resemble a stack.
0 Kudos
supersecretuser
Level 7

Re: Force kill of screen from stack

Exactly what I needed. Thanks Kevin.
0 Kudos
tBibi
Level 7

Re: Force kill of screen from stack

Is there any way to manage this operation today?
I can not remove my roScreen from the stack, the suggest method does not work this days (Close() is no longer part of roScreen object I guess)

0 Kudos
renojim
Community Streaming Expert

Re: Force kill of screen from stack

@tBibi, why do you think this no longer works?  Close() is certainly still there.  What are you trying to do?  You shouldn't have multiple roSGScreens in a stack.  Use scenes instead.

Caveat:  I am no expert on scene graph as I absolutely hate it.

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
tBibi
Level 7

Re: Force kill of screen from stack

I am using the 2D api roScreen and not the sg one. The function does not exists on that component as I understand.

0 Kudos
necrotek
Level 12

Re: Force kill of screen from stack

I think setting the screen to invalid effectively closes and removes it from the stack. I have never had a reason to use more than one roScreen. I have had to rebuild the roScreen after displaying an ad though.

0 Kudos