UNPKG

@lifeart/gxt

Version:

<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">

41 lines (39 loc) • 1.23 kB
import { Component } from '../../component'; import { TresContext } from './context'; export interface TresCanvasProps { /** Enable shadows */ shadows?: boolean; /** Pixel ratio (defaults to window.devicePixelRatio) */ dpr?: number; /** Canvas width */ width?: string; /** Canvas height */ height?: string; /** Enable debug mode (shows stats) */ debug?: boolean; /** Error handler */ onError?: (error: Error) => void; /** Called when context is ready */ onReady?: (context: TresContext) => void; } /** * TresCanvas - A canvas component for rendering Three.js scenes in GXT * * Usage: * ```gts * <TresCanvas> * <TresMesh @position={{array 0 1 0}}> * <TresBoxGeometry @args={{array 1 1 1}} /> * <TresMeshNormalMaterial /> * </TresMesh> * </TresCanvas> * ``` * * With options: * ```gts * <TresCanvas @shadows={{true}} @debug={{true}} @onReady={{this.handleReady}}> * ... * </TresCanvas> * ``` */ export declare function TresCanvas(this: Component<TresCanvasProps>): Component<any> | import('../../control-flow/if').IfCondition | import('../../control-flow/list').AsyncListComponent<any> | import('../../control-flow/list').SyncListComponent<any>;