Better effect when the player hit the ennemy
BlitzMax Forums/BlitzMax Beginners Area/Better effect when the player hit the ennemy
| ||
Hi ! i'm searching a better and fast method to display an sprite effect when the player shoot hit the sprite ennemy ship (hImage) but not destroy it yet (shield). i've this : SetColor 0,255,0 SetAlpha 0.8 SetBlend LIGHTBLEND DrawImage hImage, mx#, my#, frame SetBlend (ALPHABLEND) SetColor 255,255,255 SetAlpha 1.0 DrawImage hImage, mx#, my#, frame is there a better method ? i can't reproduce old school effect when the sprite was completely white ! |
| ||
Bump. I'm interested in this too. Is there a procedural way of making a sprite go full flat-colored without you actually having to clone every frame of every sprite and filling it with a flat color in an image editor? |
| ||
This thread might be of some help. http://www.blitzbasic.com/Community/posts.php?topic=91711 |
| ||
After reading that, I can think of making a blank image the same size as the sprite, then filling it with the color you want, then copying the original sprite frame's alpha channel. |
| ||
I would personally use white rather than your final color then you can set the color before you draw the sprite, which would allow you to change colors on the fly for some other effects, like flash between red and yellow etc. Combine with blend mode changes and alpha etc. For more effect options all without any real overhead. |
| ||
Well, if you have the alpha-channel copied alright, it all requires you to fill the entire image with the color you want. No need for blending (other than turning on Alpha Blending so just the 'shape' of the sprite is shown, not a flat-colored rectangle). |
| ||
How to adapt this code when you use several frames ? hope DrawImage WhiteImageWithAlpha,PosX,PosY, Frame <----- this ! Last edited 2010 |
| ||
YES ! Last edited 2010 |
| ||
I like it like this. |