Page 1 of 1

Transition effect with lunalua ?

Posted: Tue Feb 07, 2017 12:11 pm
by AirShip
Is it possible to make a transition effect when the player uses a teleport?

Something like that:
https://youtu.be/1m8wL53jzZo?t=46s

Re: Transition effect with lunalua ?

Posted: Tue Feb 07, 2017 8:36 pm
by PixelPest
Yes. keyhole.lua draws something like that and depending on the complexity you would use either Graphics.drawImageWP() or Graphics.drawImageToSceneWP(), graphX2.lua or imagic.lua, or Graphics.glDraw(). You'd basically check if the player is warping and then draw the effect via LunaLua

Re: Transition effect with lunalua ?

Posted: Tue Feb 07, 2017 8:46 pm
by Emral
Eh, drawImage doesn't do the job at all and graphx2 i don't think can even draw the shape.
The circle fadeout is pretty complex to do in imagic or glDraw from my understanding because you're looking for a rather complex shape (rectangle with circle hole in the middle). You'll notice that the keyhole from keyhole.lua is also pretty obviously not a circle.

For a simple fadeout, there's fade.lua, however, which might not be as fancy but still lets you do fades.
http://wohlsoft.ru/pgewiki/Fade.lua

For the effect you provided... maybe it's worth doing with a shader? Not sure.

Re: Transition effect with lunalua ?

Posted: Wed Feb 08, 2017 2:46 am
by Hoeloe
Enjl wrote: The circle fadeout is pretty complex to do in imagic or glDraw from my understanding because you're looking for a rather complex shape (rectangle with circle hole in the middle).
Not if you use capture buffer, then it's pretty easy.

Re: Transition effect with lunalua ?

Posted: Tue Mar 14, 2017 1:16 pm
by Rixitic
So I know it's been over a month since the last post but I'd heavily advise against using graphx2. It's really, really horribly optimized.
If you want to make a transition/transition API I'd suggest doing it with either Hoeloe's imagic or manually with glDraw.

Also, if someone does want to make a transition API, this is worth a watch; it's for Unity but the ideas can be applied to glDraw... might even be able to just use the shader provided with the video.