by morcior » Sat May 12, 2007 3:51 am
Thanks, I guess I should explain the effect a bit:
It uses 2 canvases. 1 for the light 'mask' , and one for drawing the shadow.
the light mask is positioned above everything, and it is cleared to black (rgb(0,0,0)) with 0.1 alpha every frame, almost completely opaque.
you then render a png file with an alpha layer (that looks like a light, radial gradients work well!) using draw_from, this bakes the alpha over the existing darkness and you get the light effect over whatever is under the actor.
its then just a case of drawing the shadow based on the lights position relative to the actor and calulating the scale. I just guessed at this code, a much better job could be done I'm sure. Its in bg2->Draw Actor