Page 1 of 1

Image Dissolve for Image Buttons?

Posted: Mon Jul 30, 2018 11:09 am
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 :(

Re: Image Dissolve for Image Buttons?

Posted: Mon Aug 06, 2018 2:50 am
by Kinmoku
Any ideas? I'm thinking I'll need another solution for this effect :?

Re: Image Dissolve for Image Buttons?

Posted: Tue Aug 07, 2018 2:30 pm
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.