Dimenticare

Lighting Extension short example

Sep 15th, 2013
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * 27 October 2018
  3.  * I don't use this anymore; in fact, I don't even remember what the name of the
  4.  * extension was in the first place. Given the drastic changes made to Game Maker
  5.  * since I pasted this (i.e. proper shaders) I don't think anyone else will either.
  6.  * I'm leaving it up, though.
  7.  */
  8.  
  9. lt_sysset(1, -1, make_color_rgb(80, 80, 0), 1, 0, 1, 1, -100);
  10.  
  11. /*  lt_sysset(enabled,view,ambient,addative,shadows,reset,autodraw,depth)
  12.     Arguments:
  13.         enabled - whether or not the light system is to be enabled or not
  14.         view - whether or not the light is to be confined to a specific view (-1 if not)
  15.         ambient - the color of the ambient light, e.g. the color outside the lighted area (c_black would be completely dark, c-white would be completely white)
  16.         additive - whether or not the light instance is to be additive or not, which is a little hard to explain so here's an example.
  17.             Additive - http://i.imgur.com/JcnQR6v.png
  18.             Non-additive - http://i.imgur.com/GhgoPbQ.png
  19.         shadows - whether or not the light is to cast shadows, which are a much more complicated story but can make the game look really cool
  20.         reset - If you're trying to reset the light system or not (probably not)
  21.         autodraw - if this is set to false, you have to manually draw the lights with
  22.             lg_redraw();
  23.         depth - the depth the light system is to be drawn at (i.e., height - usually between -10 and -100)
  24. */
  25.  
  26. light_system=lt_lightadd(light,0,x, y,1,1,0,c_white,1,0);
  27.  
  28. /*  lt_lightadd(sprite,sub,x,y,xscale,yscale,rot,color,enabled,castshadow)
  29.     Arguments:
  30.         sprite - the sprite of the light I mentioned in the PM
  31.         sub, x, y, xscale, yscale, rot, color - the same as the arguments for sprites such as
  32.             draw_sprite_ext( . . . );
  33.         enabled - once again, whether or not the specific light is enabled or not
  34.         castshadow - once again, whether the specific light is to cast shadow (if the entire system is set to not cast shadows, this won't do anything either way
  35. */
Advertisement
Add Comment
Please, Sign In to add comment