CreateLight()

Syntax

Result = CreateLight(#Light, Color [, x, y, z])
Description
Creates a new #Light of the given Color in the current world. If #PB_Any is used as '#Light' parameter, the new light number will be returned as 'Result'.

Valid colors may be easily created using the RGB() function. The new light is created at the 0,0,0 location unless the optional 'x,y,z' paremeters are specified. If the #Light was already created, it is automatically freed and replaced by the new one.

Example:
  CreateLight(0, RGB(255,0,0)) ; Creates a red light
  
  CreateLight(1, RGB(0,255,0),  0, 100.7, 50) ; Creates a green light, at the position (0, 100.7, 50)

Supported OS

All

<- CopyLight() - Light Index - FreeLight() ->