How to make an image/sprite glow...

Started by thaaks, December 22, 2005, 01:46:15 PM

Previous topic - Next topic

thaaks

Hi all,
say I have a sprite (irregular shape, for example a space ship) and I want it to glow sometimes in some color. Imagine a force field or something like that.

Are there any builtin function in PlayBasic (I'm pretty sure there are) that I can achieve such an effect?
I would love to do it programmatically to get this effect for any sprite. It doesn't matter if I would have to do it on startup to generate a separate set of "glowing" images and switch images during the game play.

Any ideas, hints, suggestions? Maybe there is already a demo or example in the PB distribution?!

Thanks in advance,
Tommy

stef

Hi!
Don't know whether this helps:

you could "underlay" a copy of the sprite
this scale a bit larger
use
SpriteFlashColour SpriteIndex, FlashColour
and
blurimage

this would surround the original sprite with a coloured "glow"

stef

medwayman

#2
Hi

Another idea

Look in the help files under – Sprites/SpriteAlphaLevel and copy the code over. You'll have to edit both of the boxcC commands as they are missing their draw mode flags so just stick a 1 in before the RndRGB() value.

You could create a cool shield sprite then fade it so you can't see it. When you want to activate the shield you can up the alpha levels so you can see the shield but still see the ship through it. I'm guessing you'll only need one shield sprite so it would be a good idea to set the StarsN value to 1 to give yourself a better idea of frame rates.

I was going to do this a while back myself, although nothing came of it in the end, but i did make the sprites. I'll see if I can find them and show you a demo of what I mean.


Edit:

Found the images.


thaaks

Thanks to both of you, Stef and medwayman.

Stef, your proposal sounds exactly like what I had in mind - I will try that first.

And medwayman, yours is looking cool and I think I can use that idea/effect too.

Thanks again for your fast help!
Tommy  :D

medwayman

#4
Hi

Here is a demo if you're interested. It's a bit crude but it works for the purpose. It shows the shield activating then fading away. It also shows a multiple hit effect where the shield reactivates before it's fully faded.

(dead link removed) It's about 6k.
:)

thaaks

QuoteHi
Here is a demo if you're interested. It's a bit crude but it works for the purpose. It shows the shield activating then fading away. It also shows a multiple hit effect where the shield reactivates before it's fully faded.
Thanks for the sample source code, that's nice looking and working pretty well.

How did you create that shield image? Photoshop? And the ship is also well done...Graphics wise I am so retarded  :(

Tommy

medwayman

#6
I used Ultimate Paint to make the images. It's really easy to do this kind of thing. It's all very random. Ask me to do something that requires talent and I'd fall flat on my face. :huh:  



For the shield I started with a filled circle then selected a fairly fine white airbrush (radius of 3 / intensity of 1) with the intensity set to 1 it will take longer for the base colour to blend with the brush colour so you can vary the shading. For the last image I used a black airbrush (or just use the delete button on the mouse) to darken the image.



Making stuff look old, dirty, or rusty is easy with the airbrush. For this image I just use black to cut holes and dirty the image, then a bit of orange for rust.

It took about 5 minutes to do both these example images, but with more time and better colour choices you could achieve much better results easily.

There is a freeware version of Ultimate Paint available if you want to try it (here) one of the best features is the instant brush tool. Perfect for pixel work. :)

stef