This function is for defining a positional light, where you can define the x, y and z position of the light, the light range and its 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_point(ind, x, y, z, range, col)


参数 描述
ind The index number of the light (arbitrary)
x The x position of the light
y The y position of the light
z The z position of the light
range The light range (in pixels)
col The colour to use for the light (either a constant, a real or a hex value).




draw_light_define_point(1, 200, 123, 50, 2000, c_white);
draw_light_enable(1, true);

The above code will enable lighting for the whole scene, then define a white light at a specific point in the room space, and then finally turn that light on.

上一页: Drawing And The Display
下一页: draw_light_define_direction
© Copyright YoYo Games Ltd. 2018 All Rights Reserved