Particles Pictures

Get help using Construct 2

Post » Mon Apr 01, 2013 11:34 pm

Hello,

I'm using the construct for the second day xD
And I have a small question, i'd like to create a debris effect, so I did 3 debris pictures and I'd like to use them in my sprite emiter, but, how can I use more than one picture?? :-/


All the best,
Alexandre
B
13
S
3
Posts: 38
Reputation: 1,471

Post » Tue Apr 02, 2013 12:03 am

Put all the debris images in a single particle's animation and then ...

On created : DebrisEmiter Set Frame to random(1,numofdebrisimages(0-based))

Cheers ...
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Tue Apr 02, 2013 1:57 am

Thanks for the reply :)

But, how I set the particle animation? I use the sprite object?
I just can set one frame :(
B
13
S
3
Posts: 38
Reputation: 1,471

Post » Tue Apr 02, 2013 8:47 pm

I made it work hacking the original particle script, but only when webgl is disabled, if someone know how can I set the texture for drawgl I'll be very happy ^^

I'll post here the component for download when working :D
B
13
S
3
Posts: 38
Reputation: 1,471

Post » Tue Apr 02, 2013 9:21 pm

Create three particle objects with different images, then overlay them on top of each other. You should never modify the scripts directly, since your changes will be reversed on updates and it will make your projects incompatible with everyone else's copy of Construct 2.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Apr 02, 2013 9:24 pm

Particles are optimized slightly to make them better than spawning multiple sprites. But not by much, if particles had the extra abilities it would become better to use sprites. So they will probably say use a sprite instead.

I have used multiple overlapping particle emitters in the past, each spewing it's own image. (IE sparks, smoke, and fire.) That may be an option.

Ashley beat me to it. ;-)Paradox2013-04-02 21:25:34
B
201
S
52
G
30
Posts: 897
Reputation: 36,621

Post » Tue Apr 02, 2013 9:38 pm

Thanks for the idea, I did this, but is very annoying to configure :(
And don't worry about compatibility issues, I made a copy, so now I have the original particle and a hacked version as different components :)
B
13
S
3
Posts: 38
Reputation: 1,471

Post » Tue Apr 02, 2013 9:42 pm

here the first build :)
https://www.dropbox.com/sh/vzh0oirg092d8sy/-J9L9xCwkR/construct2
B
13
S
3
Posts: 38
Reputation: 1,471

Post » Tue Apr 02, 2013 10:06 pm

You should also note one of the reasons the particles object is fast is because things like the single-image limitation and no rotation means it's possible to use a special heavily optimised renderer. If you hack the Particles object to swap texture, it will perform worse than using three unmodified particles objects overlaid.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Apr 02, 2013 10:29 pm

yes I know that, and sure I know my code isn't optimised yet xD

but I really not sure if this kind of modification can do big performance problem...

The idea is not swaping the texture, the true is, my code isn't very different from the original particle, the difference is, now you can set a sprite sheet and when I create the particle I set the texture frame on it... sure I'll not use it in something with a lot of particle, but for small one shot particles like debris, sparks it can work very nice...
B
13
S
3
Posts: 38
Reputation: 1,471

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests