This function is for defining a directional light, where the direction and intensity are set by the values input for the x, y and z unit vector (meaning that they must be between -1 and 1, where 1 or -1 is full intensity, and 0 is no intensity). The lights can also be given a colour, which will also affect the perceived intensity of the light as certain colours appear "darker" than others. You must also give the light an index number which what will be used in other functions to reference it.注意： There are only 8 hardware lights available, so only 8 defined lights can be enabled at any one time (although more can be defined).
draw_light_define_direction(ind, x, y, z, col)
参数 描述 ind The index number of the light (arbitrary) x The x component of the light vector y The y component of the light vector z The z component of the light vector col The colour to use for the light (either a constant, a real or a hex value).
draw_light_define_direction(1, 0, 1, 0, c_white);
The above code will enable lighting for the whole scene, then define a white directional light in the room space, and then finally turn that light on.