Page 1 of 1

[Solved] fading effect starting from the top?

Posted: Mon Sep 14, 2020 11:56 am
by Dr_arell
hi, i need to do a fading effect for a static image, a laser, and i need it to start from the top, so it gives the impression the laser is actually coming out.
i don't know if this even possible in renpy, otherwise id have to animate frame by frame the thing and its a pain.

Re: fading effect starting from the top?

Posted: Mon Sep 14, 2020 2:11 pm
by Alex
Not quite understand what you want to achieve...
Do you need a laser beam image to move over the screen? Or custom fade transition to change images (backgrounds and sprites)?

For the first one check the docs for ATL - https://www.renpy.org/doc/html/atl.html and tutorial game.
For the second - this thread - viewtopic.php?f=52&t=49804&p=484899&hil ... ve#p484899

Re: fading effect starting from the top?

Posted: Mon Sep 14, 2020 6:50 pm
by Dr_arell
more like the second one, i got a laser beam.png, just the laser, i dont need it to move, what i want it to do is to load it from the top part to the bottom, the best example i can think of to explain is the jedi laser sable activation, it stars from the bottom til it reaches the top.

ill test that out thank you

Re: fading effect starting from the top?

Posted: Tue Sep 15, 2020 8:51 am
by afrikanwizard
For me, with my limited knowledge of Ren'Py, the easiest solution would be to use one of Kirikiri's .png files for a dissolve effect. I coded something similar to what I think you're trying to achieve last night for the sequel to my VN, except the 'beam' image was a full background picture rather than a .png file with transparency to overlay on a background. But there is little difference between the two.


I think 'TR19.png' would suit your needs adequately here.


Image

Code: Select all

define shoot = ImageDissolve("TR19.png", 0.2, 8)

show laser with shoot
pause 0.5

By trial and error I found that, for my tastes, shots, beams, slashes and punches effects on a 1024x768 resolution should have the speed of the dissolve effect (the first number on the 'define' command) should be between 0.15 and 0.25. While the pause after the dissolve should be set between 0.25 and 0.5.

If you have sound file to go with the laser 'shooting' just place the command to play it before the code for the graphic effect. And you can fiddle with the speed of the transition and the after-pause lenght to make the sound fit the 'animation'.

Re: fading effect starting from the top?

Posted: Wed Sep 16, 2020 1:05 am
by Per K Grok
Dr_arell wrote:
Mon Sep 14, 2020 11:56 am
hi, i need to do a fading effect for a static image, a laser, and i need it to start from the top, so it gives the impression the laser is actually coming out.
i don't know if this even possible in renpy, otherwise id have to animate frame by frame the thing and its a pain.

I did something that might be similar to what you are looking for using crop in a game a bit back in time


Code: Select all

transform wipeDown:
    crop_relative True
    crop (0.0, 0.0, 1.0, 0.0)
    alpha 0.2
    linear 1.0 alpha 1.0 crop(0.0, 0.0, 1.0, 1.0)

Code: Select all

        show stars with dissolve:
            pos(211, 233)
        show sbShadow at wipeDown behind stars:
            pos(260, 1)