Light

A light that shades isShaded drawables. Add it to a renderer with Game.addLight() (or Renderer.addLight()).

Fields can be changed at any time, including mid-game - the renderer notices and redraws whatever the light touches. Use DirectionalLight, PointLight or AmbientLight rather than this class directly.

Properties

  • id (string) — Set by the renderer when the light is added
  • type (LightType)
  • color (integer) — RGB color (0xRRGGBB, as BGE.ColorsRGB)
  • intensity (float) — Multiplier on color. A surface's total light is capped at full brightness, so
  • enabled (boolean) — A disabled light is ignored, as if it had been removed

Constructor

new Light( lightType: LightType, color: integer, intensity: float, ): Light

Parameters

  • lightType (LightType)
  • color (integer)
  • intensity (float)