Animated imagebutton in main menu[sloved]

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
Malinovaa
Newbie
Posts: 2
Joined: Sun Mar 31, 2024 8:04 am
itch: omiforgetful
Contact:

Animated imagebutton in main menu[sloved]

#1 Post by Malinovaa »

Okay, so basically, I want to make a logo in the middle of main menu screen, that jumps when it's hovered. I don't want it to actually do anything when clicked, just make a small animation. I tried coding it in but it doesn't seem to work? There's no error message or anything, it just doesn't display the animation... I'm still learning coding so I probably messed up lol

here's the code I made for animation:

Code: Select all

image logo_hovered:
    "images/DDM_h1.png"
    pause 0.3
    "images/DDM_h2.png"
    pause 0.3
    "images/DDM_h3.png"
    pause 0.3
    "images/DDM_h2.png"
    pause 0.3
    "images/DDM_h1.png"
    pause 0.3
    repeat
and here's where I put the logo:

Code: Select all

screen main_menu():


    ## This ensures that any other menu screen is replaced.
    tag menu

    add gui.main_menu_background

    imagebutton:
        idle "images/DDM_idle.png"
        hover "logo_hovered"
        xalign 0.5
        yalign 0.5
        focus_mask True
        action None
Thank you for answering btw :>
Last edited by Malinovaa on Mon Apr 01, 2024 2:08 pm, edited 1 time in total.
Image

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2410
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Animated imagebutton in main menu

#2 Post by Ocelot »

Button without any actions will not receive any events. If you want hover events to work, you need to provide an action. You can use a built-in action which does not do anything, called NullAction()
< < insert Rick Cook quote here > >

User avatar
Malinovaa
Newbie
Posts: 2
Joined: Sun Mar 31, 2024 8:04 am
itch: omiforgetful
Contact:

Re: Animated imagebutton in main menu

#3 Post by Malinovaa »

Ah thank you so much! It works now :]
Image

CheyenneParker
Newbie
Posts: 1
Joined: Fri Mar 29, 2024 1:22 am
Contact:

Re: Animated imagebutton in main menu[sloved]

#4 Post by CheyenneParker »

I am also making a logo in the middle of main menu screen, that jumps when it's hovered but I am facing issues. That is why I am searching for the solution online and I am glad I found your post where I found my answer. I am also very happy because I also discovered the https://bigassignments.com/ website link through which I can get help from a professional essay writer regrading my essay assignments. Now, I can easily concentrate on my project instead of wasting my time on writing a lot of essay assignments.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], snotwurm