Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
supersecretuser
Channel Surfer

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
Visitor

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
Channel Surfer

Re: Force kill of screen from stack

Exactly what I needed. Thanks Kevin.
0 Kudos
tBibi
Channel Surfer

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
Channel Surfer

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
Roku Guru

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.