softworkz
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2016
01:25 PM
Re: How to programmatically exit out of scene graph's Scene?
"EnTerr" wrote:
Perhaps I should stop trying your patience 🙂 and figure out first hand if that can work with the live RSG, since "the best-laid plans of mice and men often go awry".
I apologize for my ignorance - I thought you were interested how I got it working while telling what you tried without success.. 🙂
Regarding ideas: I already had and tried so many that didn't work... Let's focus on what's actually working - hehe, but you should definitely try this because an unproofed concept is nothing worth!
Motorcykey
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2017
11:21 AM
Re: How to programmatically exit out of scene graph's Scene?
Hey,
I'm looking for something similar, but having a hard time finding the answer. Is there anything you can call from within a Scene to exit (e.g., m.top.close would be nice, but is not there)
Much like the Original Poster, I can exit the Scene using the Back Button, but would also like to do so using a button I've created on the UI.
Is there any way to listen for when my button is clicked in the main .brs component so that I could call screen.Close() when I need to? It sounds like this is the solution that was posted here by setting an observer for "LaunchSubScene":
scene.observeField("LaunchSubScene", m.port)
But I'm a bit clueless as to where LaunchSubScene lives and how it gets called.
I'm looking for something similar, but having a hard time finding the answer. Is there anything you can call from within a Scene to exit (e.g., m.top.close would be nice, but is not there)
Much like the Original Poster, I can exit the Scene using the Back Button, but would also like to do so using a button I've created on the UI.
Is there any way to listen for when my button is clicked in the main .brs component so that I could call screen.Close() when I need to? It sounds like this is the solution that was posted here by setting an observer for "LaunchSubScene":
scene.observeField("LaunchSubScene", m.port)
But I'm a bit clueless as to where LaunchSubScene lives and how it gets called.
Motorcykey
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2017
11:38 AM
Re: How to programmatically exit out of scene graph's Scene?
A-ha... all it was was adding an interface value to the component which could then be observed for any changes. I see. Very nice solution! Thanks!
aloudmind
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2017
02:06 PM
Re: How to programmatically exit out of scene graph's Scene?
In case anyone is still having an issue with this... my solution was to add a label node to the main scene xml file:
<Label id="exitApp" translation="[0,0]" text="" />
Then in my main.brs file, I observe the text value of the label node:
m.exit_app = scene.findNode("exitApp")
m.exit_app.observeField("text", m.port)
When the node.text value changes to "true", I simply call:
screen.Close()
If there is an easier/cleaner way, please let me know.
<Label id="exitApp" translation="[0,0]" text="" />
Then in my main.brs file, I observe the text value of the label node:
m.exit_app = scene.findNode("exitApp")
m.exit_app.observeField("text", m.port)
When the node.text value changes to "true", I simply call:
screen.Close()
If there is an easier/cleaner way, please let me know.
MuviDev
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2022
03:28 AM
Re: How to programmatically exit out of scene graph's Scene?
return false; from the the back or any keyEvent that you want to handle
- « Previous
-
- 1
- 2
- Next »