[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Novelty forum • View topic - Return to menu when pressing the escape key

Return to menu when pressing the escape key

Have any technical questions or suggestions? Post them here.

Return to menu when pressing the escape key

Postby poep » Sat Oct 26, 2013 1:59 am

How do I make the game move to a different chapter and page when the player presses the escape button? I can create the 'escape button pressed'-event, but don't know hot to make it move to not just a different page but a certain page in another chapter. Some help would be appreciated. Thanks in advance.
poep
 
Posts: 8
Joined: Sat Mar 23, 2013 4:42 pm

Re: Return to menu when pressing the escape key

Postby 8oni » Sat Oct 26, 2013 12:44 pm

So many idea, so little time
User avatar
8oni
 
Posts: 259
Joined: Tue Oct 30, 2012 12:23 pm

Re: Return to menu when pressing the escape key

Postby poep » Sat Oct 26, 2013 2:26 pm

Thanks for your reply, but unfortunately it doesn't seem to work. The code doesn't give an error, but when pressing the escape button it doesn't do anything.
poep
 
Posts: 8
Joined: Sat Mar 23, 2013 4:42 pm

Re: Return to menu when pressing the escape key

Postby 8oni » Sat Oct 26, 2013 5:58 pm

Looks like I need to give more detail.
Image

As you can see I have 2 Chapter here, only one of them is called 'Page 2' and this is important since you move based on the page name so they should all be different, I'm just too lazy to rename them :p

So you click on the Page where you want to put this code, I put it on Page 1 Chapter 1, then on Property Inspector I choose my function name hitEscape from the option OnKeyDown, after I compile the code off course.

And that's all.

Here is the sample project if you want to see for yourself.
Feel free to comment if this doesn't work.
Attachments
ESCAPE-PAGE.nov
(45.54 KiB) Downloaded 376 times
So many idea, so little time
User avatar
8oni
 
Posts: 259
Joined: Tue Oct 30, 2012 12:23 pm

Re: Return to menu when pressing the escape key

Postby poep » Sun Oct 27, 2013 11:36 am

Oh, I thought it would work like the 'on right click' script I have that works without being assigned to a page. So I have to assign the script to all my hundreds and hundreds of pages?
poep
 
Posts: 8
Joined: Sat Mar 23, 2013 4:42 pm

Re: Return to menu when pressing the escape key

Postby 8oni » Sun Oct 27, 2013 5:45 pm

That's an interesting idea...
*some check*
The right click script that you are talking about is assigned to Novel interface named Button : All. I have check it but it seems there is no option for OnKeyDown event on Novel interface so you can't put this code there.
And yeah, it might seems like a hard work to do, but this is the best that I can come up with in the moment. I will put this as a note for me to learn more about Novelty code then.
Sorry for not helping you much then :/

PS : Just a suggestion, you can make a button that will show a screen when clicked and that screen will have a lot of button where you can navigate to the other page. <--- ok that's a long sentece :lol:

Or you can make it so the Escape option is only avaiable to some page? No need to use this code to all the page.
So many idea, so little time
User avatar
8oni
 
Posts: 259
Joined: Tue Oct 30, 2012 12:23 pm

Re: Return to menu when pressing the escape key

Postby poep » Wed Oct 30, 2013 10:07 pm

Don't apoligize, you've helped me perfectly fine. :P

The reason I have so many pages is because of the background dissappearing when loading if you use the Transform Background function instead of making seperate pages with all of them having the next background. The reason I need the escape button to work on all of the pages except for the menu and credits, is because when you use the close button on the window itself, the game crashes. So I want to use the escape button so the player can return to the main menu and use the exit game button there so it closes properly.
poep
 
Posts: 8
Joined: Sat Mar 23, 2013 4:42 pm

Re: Return to menu when pressing the escape key

Postby fleet » Thu Oct 31, 2013 2:55 am

Why? I like big ones, that's why.
User avatar
fleet
 
Posts: 871
Joined: Tue Aug 31, 2010 12:03 am
Location: USA

Re: Return to menu when pressing the escape key

Postby poep » Mon Nov 11, 2013 3:16 pm

I don't have room for a close/exit button in my interface. Besides, I would have to add the button to every scene anyway.
poep
 
Posts: 8
Joined: Sat Mar 23, 2013 4:42 pm


Return to Support & Development

Who is online

Users browsing this forum: No registered users and 3 guests

cron