Image Dissolve for Image Buttons?

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Image Dissolve for Image Buttons?

#1 Post by Kinmoku »

Hi all,

I have some imagebuttons that I want to animate. When hovered, I want the image to appear as though it's being painted. I've been using Image Dissolve for this effect so far in my game.

However, I'm stuck :( I've tried a few things but I can't seem to get Image Dissolve to work (or even a normal dissolve with ATL/ alpha!)

Here's my current code...

In screens:

Code: Select all

    imagebutton idle "truckidle" hover "truckhover" clicked Return('truck') xpos 0 ypos 183
In script:

Code: Select all

image truckidle = "images/summer1/search_truck1.jpg"
image truckhover:
    "images/summer1/search_truck.jpg" with ImageDissolve("images/summer1/search_truck_bw.jpg", 1.0, reverse=False, ramplen=50) ## Doesn't work, but doesn't crash
But it just shows the replacement image immediately on hover.

Is it possible to do this? I'm thinking it's probably easier to use animated sprites/ video files at this point :(

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Image Dissolve for Image Buttons?

#2 Post by Kinmoku »

Any ideas? I'm thinking I'll need another solution for this effect :?

User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: Image Dissolve for Image Buttons?

#3 Post by Qlara »

In my game I have a vertical menu that shows a different image upon hovering for each button.
Before a few people here helped me out with the code, I had the following problem: When moving my mouse quickly over the menu buttons the unhover command would not be triggered and the hover images piled up on top of one another.
Now, I wonder how Ren'py should handle a one-second dissolve effect when you have no control over the duration of the hover. Imagine moving through the menu quickly, should the dissolve break off or finish? What happens when a new dissolve is triggered in the middle of an ongoing one?
Sorry, I have no solution, I just wanted to point out why it might be difficult, because in my case it hadn't occurred to me that I could actually hover all buttons within a second.
I wonder if your effect would work on click instead of hover.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot