Call If player right-clicked

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
User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Call If player right-clicked

#1 Post by Westeford »

Just a silly idea. I want to call a statement if the player right-clicked.
Something like this.

Code: Select all

"Your inventory has been added to the pause menu."
"Right click to open the pause menu."
if [pressed right mouse button]:
	"I bet you just did it now. Perhaps you noticed the save menu too."
else:
	"The pause menu is also where you save. Keep that in mind."
I'm wondering if it's possible to do something like that.
Thank you for your time.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Call If player right-clicked

#2 Post by Imperf3kt »

You can use a button with "alternate" action that calls a label, containing your statement.
Put it in a screen and call the screen when needed.

The button code would look like

Code: Select all

    textbutton _("Press me") alternate Call mystatement
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Bing [Bot]