How to change mouse right click fuction?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
caibanh
Newbie
Posts: 20
Joined: Wed Jan 25, 2017 1:20 pm
Contact:

How to change mouse right click fuction?

#1 Post by caibanh »

I want show game menu screen instead of save screen but don't know how. I did try the menthod below:
screen game_menu_button():
key "K_ESCAPE" action ShowMenu("game_menu")
key "mouseup_3" action ShowMenu("game_menu")

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: How to change mouse right click fuction?

#2 Post by Per K Grok »

caibanh wrote: Fri Jun 19, 2020 12:30 pm I want show game menu screen instead of save screen but don't know how. I did try the menthod below:
screen game_menu_button():
key "K_ESCAPE" action ShowMenu("game_menu")
key "mouseup_3" action ShowMenu("game_menu")
You should take a look at customizing how certain keys are mapped to certain actions
https://www.renpy.org/doc/html/keymap.html

You will see that mouseup_3 already is mapped to game_menu.

game_menu = [ 'K_ESCAPE', 'K_MENU', 'mouseup_3' ]

Game_menu is sort of a templet used for different game menus, including save.
It is used in different game menus through a line like this.

use game_menu(title)

When you just call game_menu you get the save menu. I don't know why.

So you need to decide which game_menu you want to call and call that specifically.

If you want to use right click you first need to remove that from the mapping like this.

$ config.keymap['game_menu'].remove('mouseup_3')

User avatar
Alex
Lemma-Class Veteran
Posts: 3098
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How to change mouse right click fuction?

#3 Post by Alex »

Just set _game_menu_screen variable to desirable screen name (like 'game_menu').

Code: Select all

label start:
    $ _game_menu_screen = 'game_menu'
https://www.renpy.org/doc/html/store_va ... enu_screen

caibanh
Newbie
Posts: 20
Joined: Wed Jan 25, 2017 1:20 pm
Contact:

Re: How to change mouse right click fuction?

#4 Post by caibanh »

Alex wrote: Fri Jun 19, 2020 1:08 pm Just set _game_menu_screen variable to desirable screen name (like 'game_menu').

Code: Select all

label start:
    $ _game_menu_screen = 'game_menu'
https://www.renpy.org/doc/html/store_va ... enu_screen
it's working! thank you very very very much!

caibanh
Newbie
Posts: 20
Joined: Wed Jan 25, 2017 1:20 pm
Contact:

Re: How to change mouse right click fuction?

#5 Post by caibanh »

Alex wrote: Fri Jun 19, 2020 1:08 pm Just set _game_menu_screen variable to desirable screen name (like 'game_menu').

Code: Select all

label start:
    $ _game_menu_screen = 'game_menu'
https://www.renpy.org/doc/html/store_va ... enu_screen
Hello again. For some reason it not working anymore after I custom some other screen. It so much like when I use the $ quick_menu = False code, it working at first but not working anymore. I'm really confused at this...

User avatar
Alex
Lemma-Class Veteran
Posts: 3098
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How to change mouse right click fuction?

#6 Post by Alex »

caibanh wrote: Sun Jun 21, 2020 6:57 am ... For some reason it not working anymore after I custom some other screen. ...
Try to set it back to 'save' screen to test if it working at all.
If it will show you the save screen then check what you've changed in your 'game_menu' screen.
If not - check the changes you've made in game menu screens.

If this won't help you to solve the issue, provide more information, like the code for your 'game_menu' screen (the screen, you want to show via right click), other customizations of game menu system you've made.

caibanh
Newbie
Posts: 20
Joined: Wed Jan 25, 2017 1:20 pm
Contact:

Re: How to change mouse right click fuction?

#7 Post by caibanh »

Alex wrote: Sun Jun 21, 2020 7:10 am
caibanh wrote: Sun Jun 21, 2020 6:57 am ... For some reason it not working anymore after I custom some other screen. ...
Try to set it back to 'save' screen to test if it working at all.
If it will show you the save screen then check what you've changed in your 'game_menu' screen.
If not - check the changes you've made in game menu screens.

If this won't help you to solve the issue, provide more information, like the code for your 'game_menu' screen (the screen, you want to show via right click), other customizations of game menu system you've made.
Hello, thank you for your reply!
I tried 'load' and other screen but it not working as well. But my friend recommend I should build the game and see, and it actually still working! Just not working when I lauch it as project.
Thank you again for your patience with me!

Post Reply

Who is online

Users browsing this forum: No registered users