First my idea was a remove render.clear, but result is strange:
Maybe somebody know how to this? Thanks.
First my idea was a remove render.clear, but result is strange:
Maybe somebody know how to this? Thanks.
Draw to a buffer?
Looks like problem you have in your image is that real cards are still being drawn on top. You need to maybe disable card drawing until they cascade away?
Ah, I think that is due to the double buffering… But you should be able to do it by rendering to a texture/render target instead (ie. and removing the render.clear call when you want that effect).
@Pkeod was faster than me!
@Pkeod @sven Thank you!
I am bad in OpenGL things. (
Ok, i’ll try. Maybe you know examples with something that can help me?
I know how to make it in theory, I made this things using other technology. In most cases it’s about drawing sprite into bitmapdata(texture) many times.
But I don’t know how to make it in Defold.
for example phaser (one method for drawing sprite into bitmapdata) https://phaser.io/examples/v2/bitmapdata/draw-sprite
Hmm, I was thinking it would be easier to use a particle effect (with a very long life time), but they draw in the opposite order of what you want.
So here’s a quick little demo project doing it with a render target that you don’t clear. I copied most of the render script from another project, so it has a bunch of extra stuff in there to refresh the render target if you change the window size (which won’t work for your purpose), but hopefully it gives you the general idea.
Render Target Cards.zip (42.6 KB)
A bunch of the render target code I originally got from of this thread: Draw render target to screen (SOLVED)
Wow! Thank you very much!
Your example helped me to understand how its works. Now this puzzle assembled in my head.
Turns out it’s easy =)
One more big thanks!
Awesome, glad to help!
Yeah, it’s easy, though my example was overly-complicated. Basically just:
(for anyone reading in the future)