/** * A 2D point light. * Note: this is a very experimental and work in progress feature, that provides a simple spot light effect. * The light effect is best rendered in WebGL, as they are few limitations when using the Canvas Renderer * (multiple lights are not supported, alpha component of the ambient light is ignored) * @see stage.lights */ export default class Light2d extends Renderable { /** * @param {number} x - The horizontal position of the light. * @param {number} y - The vertical position of the light. * @param {number} radiusX - The horizontal radius of the light. * @param {number} [radiusY=radiusX] - The vertical radius of the light. * @param {Color|string} [color="#FFF"] - the color of the light * @param {number} [intensity=0.7] - The intensity of the light. */ constructor(x: number, y: number, radiusX: number, radiusY?: number, color?: Color | string, intensity?: number); /** * the color of the light * @type {Color} * @default "#FFF" */ color: Color; /** * The horizontal radius of the light * @type {number} */ radiusX: number; /** * The vertical radius of the light * @type {number} */ radiusY: number; /** * The intensity of the light * @type {number} * @default 0.7 */ intensity: number; /** @ignore */ visibleArea: Ellipse; /** @ignore */ texture: CanvasRenderTarget; /** * returns a geometry representing the visible area of this light * @returns {Ellipse} the light visible mask */ getVisibleArea(): Ellipse; /** * update function * @param {number} dt - time since the last update in milliseconds. * @returns {boolean} true if dirty */ update(): boolean; /** * draw this Light2d (automatically called by melonJS) * @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance * @param {Camera2d} [viewport] - the viewport to (re)draw */ draw(renderer: CanvasRenderer | WebGLRenderer): void; /** * Destroy function
* @ignore */ destroy(): void; } import Renderable from "./renderable.js"; import type { Color } from "./../math/color.ts"; import type { Ellipse } from "./../geometries/ellipse.ts"; import CanvasRenderTarget from "../video/rendertarget/canvasrendertarget.js"; import type CanvasRenderer from "./../video/canvas/canvas_renderer.js"; import type WebGLRenderer from "./../video/webgl/webgl_renderer.js"; //# sourceMappingURL=light2d.d.ts.map