@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
49 lines (48 loc) • 2.14 kB
TypeScript
import { Object3D } from 'three';
import * as ThreeMeshUI from 'three-mesh-ui';
import { ComponentInit } from '../../engine/engine_types.js';
import { Behaviour } from "../Component.js";
import type { ICanvas } from './Interfaces.js';
export declare const includesDir = "./include";
/**
* Derive from this class if you want to implement your own UI components.
* It provides utility methods and simplifies managing the underlying three-mesh-ui hierarchy.
* @category User Interface
* @group Components
*/
export declare class BaseUIComponent extends Behaviour {
/** Is this object on the root of the UI hierarchy ? */
isRoot(): boolean;
/** Access the parent canvas component */
get canvas(): ICanvas | null;
/** @deprecated use `canvas` */
protected get Canvas(): ICanvas | null;
/** Mark the UI dirty which will trigger an THREE-Mesh-UI update */
markDirty(): void;
/** the underlying three-mesh-ui */
get shadowComponent(): Object3D | null;
private set shadowComponent(value);
private _shadowComponent;
private _controlsChildLayout;
get controlsChildLayout(): boolean;
set controlsChildLayout(val: boolean);
private _root?;
protected get Root(): UIRootComponent | null;
protected _parentComponent?: BaseUIComponent | null;
__internalNewInstanceCreated(args: ComponentInit<this>): this;
onEnable(): void;
/** Add a three-mesh-ui object to the UI hierarchy
* @param container the three-mesh-ui object to add
* @param parent the parent component to add the object to
*/
protected addShadowComponent(container: any, parent?: BaseUIComponent): void;
protected setShadowComponentOwner(current: ThreeMeshUI.MeshUIBaseElement | Object3D | null | undefined): void;
private traverseOwnedShadowComponents;
/** Remove the underlying UI object from the hierarchy */
protected removeShadowComponent(): void;
protected onAfterAddedToScene(): void;
setInteractable(value: boolean): void;
}
export declare class UIRootComponent extends BaseUIComponent {
awake(): void;
}