[SOLVED]Hiding Quick Menu with Animations Transforms...

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
wyverngem
Miko-Class Veteran
Posts: 615
Joined: Mon Oct 03, 2011 7:27 pm
Completed: Simple as Snow, Lady Luck's Due,
Projects: Aether Skies, Of the Waterfall
Tumblr: casting-dreams
itch: castingdreams
Location: USA
Contact:

[SOLVED]Hiding Quick Menu with Animations Transforms...

#1 Post by wyverngem » Sat Oct 15, 2016 1:25 am

I've seen this really nice technique where games will hide their quick menu if it's not being hovered. So they show the menu and then it hides down with only the very top part of the menu being shown. When the user hovers their mouse over the name it slides up and reveals the hidden buttons. Is there a way to do this in renpy with the new scripts? I've been looking for this for a long time and have tried on my own, but can't seem to wrap my head around it.

I can get the an imagebutton to act with an ALT, but I can't get an imagemap to do the same thing. Is there a way to do this with an image map?

Even those it at the alt and it's right position the image map won't move up when focused.

Code: Select all

screen quick_menu():

    # Ensure this appears on top of other screens.
    zorder 100
    imagemap:
        at qmc_anim
        auto "gui/qm_%s.png"
        alpha False
        hotspot (0, 0, 1918, 58) action Null 
        hotspot (491, 60, 77, 41) action Rollback() alt _("Rollback")
        hotspot (604, 60, 100, 44) action ShowMenu('history') alt _("History")
        hotspot (738, 62, 77, 44) action Skip() alternate Skip(fast=True, confirm=True)  alt _("Skip")
        hotspot (847, 63, 82, 41) action Preference("auto-forward", "toggle") alt _("Auto-Forward")
        hotspot (954, 62, 82, 46) action ShowMenu('save') alt _("Save")
        hotspot (1064, 56, 105, 52) action QuickSave() alt _("Quick Save")
        hotspot (1210, 56, 98, 55) action QuickLoad() alt _("Quick Load")
        hotspot (1348, 59, 92, 46) action ShowMenu('preferences') alt _("Prefernces")

            # textbutton _("Save")
            # textbutton _("Q.Save")
            # textbutton _("Q.Load")
            # textbutton _("Prefs") 

transform qmc_anim:
    xalign 0.5
    ypos 1030
    on hover:
        linear .25 ypos 955
        linear .25 alpha 1.0
    on idle:
        linear .25 ypos 1030    
        linear .25 alpha 0.5
Last edited by wyverngem on Sun Oct 16, 2016 11:26 pm, edited 1 time in total.

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Hiding Quick Menu with Animations Transforms and Imagema

#2 Post by Kia » Sun Oct 16, 2016 5:48 am

if you're looking for something like this: https://www.youtube.com/watch?v=9XNzgvUr9Pw
you need to feed the ypos to the transformation as a variable.

Code: Select all

transform rettt(x=0):
    easeout .4 xpos x

User avatar
wyverngem
Miko-Class Veteran
Posts: 615
Joined: Mon Oct 03, 2011 7:27 pm
Completed: Simple as Snow, Lady Luck's Due,
Projects: Aether Skies, Of the Waterfall
Tumblr: casting-dreams
itch: castingdreams
Location: USA
Contact:

Re: Hiding Quick Menu with Animations Transforms and Imagema

#3 Post by wyverngem » Sun Oct 16, 2016 11:26 pm

Kia wrote:if you're looking for something like this: https://www.youtube.com/watch?v=9XNzgvUr9Pw
you need to feed the ypos to the transformation as a variable.

Code: Select all

transform rettt(x=0):
    easeout .4 xpos x
Thank you for the hint. :D I was able to adapt it to get it to function. I modified the quick_menu() screen to quick_menu as with the () it wouldn't function. The second thing was that in the start label I had to add a "show screen quick_menu" to get it to work. It might be in my say screen that there's a () and it's not recognizing the screen, but I will play with that later. Right now it works for me.

Code: Select all

define qmpos=0
transform qmpost(x=0):
    easeout .4 yoffset x

screen quick_menu:
    zorder 100
    frame:
        background None
        xsize 1920
        ysize 130
        xalign 0.0
        yalign 1.08
        at qmpost(qmpos)
        imagemap:
            auto "gui/qm_%s.png"
            alpha False
            hotspot (0, 0, 1918, 58) action SetVariable('qmpos', qmpos) hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (491, 60, 77, 41) action Rollback() alt _("Rollback") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (604, 60, 100, 44) action ShowMenu('history') alt _("History") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (738, 62, 77, 44) action Skip() alternate Skip(fast=True, confirm=True)  alt _("Skip") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (847, 63, 82, 41) action Preference("auto-forward", "toggle") alt _("Auto-Forward") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (954, 62, 82, 46) action ShowMenu('save') alt _("Save") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (1064, 56, 105, 52) action QuickSave() alt _("Quick Save") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (1210, 56, 98, 55) action QuickLoad() alt _("Quick Load") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
            hotspot (1348, 59, 92, 46) action ShowMenu('preferences') alt _("Prefernces") hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0)
        textbutton _(" ") action SetVariable('qmpos', qmpos) hovered SetVariable('qmpos', -75) unhovered SetVariable('qmpos', 0) xfill True yfill True background None

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]