You are currently viewing the gmlscripts.pro static mirror. Forum access and script submissions are not available through this mirror.

Invert gmlscripts.pro

motion_blur

motion_blur(length,direction)
Draws the assigned sprite of the calling instance, using its subimage, position, scaling, rotation, and blending settings, with a motion blur effect applied to it.
COPY
  1. /// motion_blur(length,direction)
  2. //
  3. // Draws the assigned sprite of the calling instance, using its
  4. // subimage, position, scaling, rotation, and blending settings,
  5. // with a motion blur effect applied to it.
  6. //
  7. // length length of blur, real
  8. // direction direction of blur in degrees, real
  9. //
  10. /// gmlscripts.pro/license
  11. {
  12. length = argument0;
  13.  
  14. if (length > 0) {
  15. step = 3;
  16. dir = degtorad(argument1);
  17. px = cos(dir);
  18. py = -sin(dir);
  19.  
  20. a = image_alpha/(length/step);
  21. if (a >= 1) {
  22. draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,
  23. image_yscale,image_angle,image_blend,image_alpha);
  24. a /= 2;
  25. }
  26.  
  27. for(i=length;i>=0;i-=step) {
  28. draw_sprite_ext(sprite_index,image_index,x+(px*i),y+(py*i),
  29. image_xscale,image_yscale,image_angle,image_blend,a);
  30. }
  31. } else {
  32. draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,
  33. image_yscale,image_angle,image_blend,image_alpha);
  34. }
  35. return 0;
  36. }

Contributors: Keth

GitHub: View · Commits · Blame · Raw