Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// draw_sprite_hdr_ext(sprite,subimg,x,y,xscale,yscale,rotate,r,g,b,alpha)
- {
- var sprite, subimg, xposit, yposit, xscale, yscale, rotate, hdrRed, hdrGrn, hdrBlu, alpha;
- sprite = argument0;
- subimg = argument1;
- xposit = argument2;
- yposit = argument3;
- xscale = argument4;
- yscale = argument5;
- rotate = argument6;
- hdrRed = argument7;
- hdrGrn = argument8;
- hdrBlu = argument9;
- alpha = argument10;
- // normal draw mode for the first pass
- draw_set_blend_mode(bm_normal);
- do {
- // determine color blending for this pass
- color = make_color_rgb(min(max(0,hdrRed),255), min(max(0,hdrGrn),255), min(max(0,hdrBlu),255));
- // draw the sprite with color blending
- draw_sprite_ext(sprite, subimg, xposit, yposit, xscale, yscale, rotate, color, alpha);
- // remove a full pass of light
- hdrRed -= 255;
- hdrGrn -= 255;
- hdrBlu -= 255;
- // every subsequent pass is drawn with add
- draw_set_blend_mode(bm_add);
- // keep drawing until there is no more light
- } until (max(hdrRed, hdrGrn, hdrBlu) <= 0);
- draw_set_blend_mode(bm_normal);
- }
Add Comment
Please, Sign In to add comment