Disappearing quick menu [SOLVED!]

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
beastcarving
Regular
Posts: 139
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

Disappearing quick menu [SOLVED!]

#1 Post by beastcarving » Wed Apr 01, 2020 8:18 am

I have a quick question. How do you make the quick menu disappear after a few idle seconds, then reappear once moving the mouse/pressing the space-bar again?
Last edited by beastcarving on Tue Apr 07, 2020 5:50 pm, edited 1 time in total.
Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

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: Disappearing quick menu [HELP!]

#2 Post by Per K Grok » Wed Apr 01, 2020 11:05 am

beastcarving wrote:
Wed Apr 01, 2020 8:18 am
I have a quick question. How do you make the quick menu disappear after a few idle seconds, then reappear once moving the mouse/pressing the space-bar again?
To turn of and on the quick menu you can use
$ quick_menu = False
$ quick_menu = True

User avatar
beastcarving
Regular
Posts: 139
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

Re: Disappearing quick menu [HELP!]

#3 Post by beastcarving » Wed Apr 01, 2020 8:08 pm

How do I control how many seconds go by before the quick-menu disappears?
Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

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: Disappearing quick menu [HELP!]

#4 Post by Per K Grok » Thu Apr 02, 2020 5:35 am

beastcarving wrote:
Wed Apr 01, 2020 8:08 pm
How do I control how many seconds go by before the quick-menu disappears?
You could use a pause or you could use a timer. Kind of depends on the situation and how you want it to work in relation to other things in the game.

User avatar
beastcarving
Regular
Posts: 139
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

Re: Disappearing quick menu [HELP!]

#5 Post by beastcarving » Sun Apr 05, 2020 12:00 am

I need help. I what this code to work the same as when you're not moving the mouse, and it will disappear after 10 seconds, then reappear when you move the mouse again.

init:
$ time = 0.5
$ timer_range = 0.5
$ timer_jump = quick_menu = False
Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

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: Disappearing quick menu [HELP!]

#6 Post by Per K Grok » Sun Apr 05, 2020 6:06 am

beastcarving wrote:
Sun Apr 05, 2020 12:00 am
I need help. I what this code to work the same as when you're not moving the mouse, and it will disappear after 10 seconds, then reappear when you move the mouse again.

init:
$ time = 0.5
$ timer_range = 0.5
$ timer_jump = quick_menu = False

If you show this screen the quick menu will be hidden if the mouse is not moved for 10 seconds.
The quick menu will be shown again if you use the mouse or space bar.

Code: Select all

default mX=0
default mY=0
default fx=0
default fy=0
default lx=0
default ly=0
default iTime=0

screen inactive():
    $ mX, mY = renpy.get_mouse_pos()

    timer 0.1 action [SetVariable("lx",fx), SetVariable("ly",fy), SetVariable("fx",mX),SetVariable("fy",mY)] repeat True

    if lx==fx and ly==fy:
        timer 0.1 action SetVariable("iTime", iTime+1)  repeat True
        if iTime>99:
            timer 0.1 action SetVariable("quick_menu", False)
    else:
        timer 0.1 action [SetVariable("quick_menu", True), SetVariable("iTime", 0)]

    key "K_SPACE" action [SetVariable("quick_menu", True), SetVariable("iTime", 0)]
    

User avatar
beastcarving
Regular
Posts: 139
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

Re: Disappearing quick menu [HELP!]

#7 Post by beastcarving » Mon Apr 06, 2020 11:02 pm

Thanks! It works perfectly. I have one more question though.
How do I make the menu also disappear each time I'm clicking?
I was thinking it's look something like this, similar to the line about the Space-bar.
This is what I tried:

Code: Select all

    clicked action [SetVariable("quick_menu", False), SetVariable("iTime", 0)] 
Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

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: Disappearing quick menu [HELP!]

#8 Post by Per K Grok » Tue Apr 07, 2020 1:53 am

beastcarving wrote:
Mon Apr 06, 2020 11:02 pm
Thanks! It works perfectly. I have one more question though.
How do I make the menu also disappear each time I'm clicking?
I was thinking it's look something like this, similar to the line about the Space-bar.
This is what I tried:

Code: Select all

    clicked action [SetVariable("quick_menu", False), SetVariable("iTime", 0)] 
you catch left mousebutton down this way

key "mousedown_1"

You have information on different keys here
https://www.renpy.org/doc/html/keymap.html

User avatar
beastcarving
Regular
Posts: 139
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

Re: Disappearing quick menu [HELP!]

#9 Post by beastcarving » Tue Apr 07, 2020 5:49 pm

Thanks. I appreciate it.
Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

Post Reply

Who is online

Users browsing this forum: No registered users