UNPKG

@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.

52 lines (51 loc) 2.83 kB
import { IContext } from "../engine_types.js"; /** * Use the ButtonsFactory to create buttons with icons and functionality * Get access to the default buttons by using `ButtonsFactory.instance` * The factory will create the buttons if they don't exist yet, and return the existing ones if they do (this allows you to reparent or modify created buttons) */ export declare class ButtonsFactory { private static _instance?; /** * Get access to the default HTML button factory. * Use this to get or create default Needle Engine buttons that can be added to your HTML UI * If you want to create a new factory and create new button instances instead of shared buttons, use `ButtonsFactory.create()` instead */ static get instance(): ButtonsFactory; /** * Get access to the default HTML button factory. * Use this to get or create default Needle Engine buttons that can be added to your HTML UI * If you want to create a new factory and create new button instances instead of shared buttons, use `ButtonsFactory.create()` instead */ static getOrCreate(): ButtonsFactory; /** create a new buttons factory */ static create(): ButtonsFactory; private _fullscreenButton?; /** * Get the fullscreen button (or undefined if it doesn't exist yet). Call {@link ButtonsFactory.createFullscreenButton} to get or create it */ get fullscreenButton(): HTMLButtonElement | undefined; /** Create a fullscreen button (or return the existing one if it already exists) */ createFullscreenButton(ctx: IContext): HTMLButtonElement | null; private _muteButton?; /** Get the mute button (or undefined if it doesn't exist yet). Call {@link ButtonsFactory.createMuteButton} to get or create it */ get muteButton(): HTMLButtonElement | undefined; /** Create a mute button (or return the existing one if it already exists) */ createMuteButton(ctx: IContext): HTMLButtonElement; private _qrButton?; /** * Get the QR code button (or undefined if it doesn't exist yet). Call {@link ButtonsFactory.createQRCode} to get or create it */ get qrButton(): HTMLButtonElement | undefined; private _customQRButtonUrl; /** Get or set the QR code button URL - this URL will open when scanning the QR code */ set qrButtonUrl(url: string); get qrButtonUrl(): string; /** Create a QR code button (or return the existing one if it already exists) * The QR code button will show a QR code that can be scanned to open the current page on a phone * The QR code will be generated with the current URL when the button is clicked * @returns the QR code button element */ createQRCode(): HTMLButtonElement; private hideElementDuringXRSession; }