three-game-engine
Version:
Simple light-weight game engine using three.js, three-mesh-ui and rapier
36 lines (35 loc) • 1.45 kB
TypeScript
import * as THREE from 'three';
import AssetStore from '../assets/AssetStore';
export interface UserInterfaceJSON {
type: 'Text' | 'Block' | 'InlineBlock' | 'Keyboard';
children?: UserInterfaceJSON[];
offset?: number;
width?: number;
height?: number;
fontSize?: number;
padding?: number;
margin?: number;
contentDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
justifyContent?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
alignItems?: 'start' | 'end' | 'center' | 'stretch';
interline?: number;
hiddenOverflow?: boolean;
bestFit?: 'none' | 'shrink' | 'grow' | 'auto';
backgroundColor?: THREE.Color;
backgroundOpacity?: number;
backgroundTexture?: THREE.Texture;
backgroundSize?: 'stretch' | 'contain' | 'cover';
borderRadius?: number | number[];
borderWidth?: number;
borderColor?: THREE.Color;
content?: string;
fontKerning?: 'none' | 'normal';
letterSpacing?: number;
textAlign?: 'left' | 'center' | 'right' | 'justify' | 'justify-left' | 'justify-center' | 'justify-right';
whitespace?: 'normal' | 'pre-line' | 'pre-wrap' | 'pre' | 'nowrap';
breakOn?: string;
fontColor?: THREE.Color;
fontOpacity?: number;
fontSupersampling?: number;
}
export declare const createUIComponent: (userInterfaceJSON: any, parentObject3D: THREE.Object3D, assetStore: AssetStore) => Promise<void>;