I have a fire particle emitter in my project and I have it following a football. My goal is to make the football look like it is on fire but the problem is when I add it to the screen it can only be in front of the football or behind it. I want to be able to add it to the screen and make it transparent so that the football will still show through to a certain point. Does anyone now how I would go about doing this?
\$\begingroup\$
\$\endgroup\$
5
-
\$\begingroup\$ I couldn't help my self but to ask if you going to create super slim soccer clone? \$\endgroup\$– Ali1S232Commented May 29, 2012 at 15:28
-
\$\begingroup\$ and besides I really don't get what the problem is, I mean what's wrong with drawing too many sprites with same texture attached to an spritebatchnode? \$\endgroup\$– Ali1S232Commented May 29, 2012 at 15:30
-
\$\begingroup\$ I am trying to add the particle emitter in front of the football and there for it completely covers it. So I want to be able to make the emitter transparent or something so that the football sprite shows through! \$\endgroup\$– StephenCommented May 29, 2012 at 15:51
-
\$\begingroup\$ so you mean particles don't alpha blend like other stuff? and besides why don't you put the ball in front of those particles? \$\endgroup\$– Ali1S232Commented May 29, 2012 at 15:57
-
\$\begingroup\$ I tried doing it both ways but I guess I don't know which alpha blending mode to use! \$\endgroup\$– StephenCommented May 29, 2012 at 16:02
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
2
I would go with this method:
- draw the ball object,
- then draw the particles over it with alpha blending enabled
- redraw the ball in exact same position but this time use lower opacity for the whole sprite (maybe something around 40%)
This way you'll both see the ball everywhere even if no particles are drawn at that pixel(caused by the back ball picture), and you can always see the ball.
And for blending method just use the normal function implemented by default.