UNPKG

@playcanvas/react

Version:

A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.

35 lines (34 loc) 1.08 kB
import { FC } from "react"; import { ScreenComponent } from "playcanvas"; import { PublicProps, Serializable } from "../utils/types-utils.ts"; /** * The Screen component allows an entity to render a 2D screen space UI element. * This is useful for creating UI elements that are rendered in screen space rather than world space. * * @param {ScreenProps} props - The props to pass to the screen component. * @see https://api.playcanvas.com/engine/classes/ScreenComponent.html * * @example * <Entity> * <Screen screenSpace={true} /> * </Entity> */ export declare const Screen: FC<ScreenProps>; interface ScreenProps extends Partial<Serializable<PublicProps<ScreenComponent>>> { /** * Whether the screen is rendered in screen space. * @default true */ screenSpace?: boolean; /** * The reference resolution of the screen. * @default [1280, 720] */ referenceResolution?: [number, number]; /** * The scale mode of the screen. * @default "blend" */ scaleMode?: "blend" | "stretch" | "fit"; } export {};