UNPKG

@dcl/ecs

Version:
68 lines (67 loc) 2.26 kB
/** * @alpha * This file initialization is an alpha one. This is based on the old-ecs * init and it'll be changing. */ import { IEngine } from '../../engine'; import { Task } from '../../systems/async-task'; import { PointerEventsSystem } from '../../systems/events'; import { IInputSystem } from './../../engine/input'; import { RaycastSystem } from '../../systems/raycast'; import { VideoEventsSystem } from '../../systems/videoEvents'; import { TweenSystem } from '../../systems/tween'; /** * @public * The engine is the part of the scene that sits in the middle and manages all of the other parts. * It determines what entities are rendered and how players interact with them. * It also coordinates what functions from systems are executed and when. * * @example * import { engine } from '@dcl/sdk/ecs' * const entity = engine.addEntity() * engine.addSystem(someSystemFunction) * */ export declare const engine: IEngine; /** * @public * Input system manager. Check for button events * @example * inputSystem.isTriggered: Returns true if an input action ocurred since the last tick. * inputSystem.isPressed: Returns true if an input is currently being pressed down. It will return true on every tick until the button goes up again. * inputSystem.getInputCommand: Returns an object with data about the input action. */ export declare const inputSystem: IInputSystem; export { IInputSystem }; /** * @public * Register callback functions to a particular entity on input events. */ export declare const pointerEventsSystem: PointerEventsSystem; export { PointerEventsSystem }; /** * @public * Register callback functions to a particular entity on raycast results. */ export declare const raycastSystem: RaycastSystem; export { RaycastSystem }; /** * @public * Register callback functions to a particular entity on video events. */ export declare const videoEventsSystem: VideoEventsSystem; export { VideoEventsSystem }; /** * @public * Register callback functions to a particular entity on video events. */ export declare const tweenSystem: TweenSystem; export { TweenSystem }; /** * @public * Runs an async function */ export declare const executeTask: (task: Task<unknown>) => void; /** * @public */ export type { Task };