-1

I created a roSGScreen instance (screen1) and pushed the screen from the main class into the screen stack. Then I pushed another screen (screen2) into the stack. Now I want to remove the screen (pop from the screen stack) programmatically. The ScreenGraph API says that close() function call will do the action but how do I get the screen instance and where should I call the method (I'm doing it in a Task component) are not clear for me.

Please help me to understand the object management in brightscript especially in screen stack

ganka
  • 191
  • 1
  • 11

2 Answers2

1

You should not create more than one roSGScreen instances in your app. Creating the screen layouts and it's components should be done using the nodes. Even Roku documentation also recommends the same.

While it is technically possible to have more than one scene per channel, we recommend you only have one roSGScreen and one Scene node. Child nodes of the scene can be treated as different "scenes" where you can then implement transitions between them.

https://sdkdocs.roku.com/display/sdkdoc/Scene

Abhishek
  • 3,304
  • 4
  • 30
  • 44
1

Screen stack model it's deprecated.

SceneGraph applications can control the flow of screen elements in the following ways:

  • by responding to user remote control key press events by responding to changes in data, including data that configures the screen elements
  • by changing the z-order of screen elements
  • by changing the parent-child relationships of screen elements
  • by creating and deleting screen elements
  • by making screen elements invisible and making other screen elements visible
  • by placing remote control focus on screen elements that may be currently off the screen or otherwise not visible

Many of the more complex SceneGraph node classes are designed to automatically respond to remote control key press events, and configure themselves in response to data changes.

Follow: https://sdkdocs.roku.com/display/sdkdoc/Controlling+Screen+Program+Flow

Tudor
  • 11
  • 2