@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
28 lines (27 loc) • 1.03 kB
TypeScript
import { FC } from "react";
import { AnimComponent, Asset } from "playcanvas";
import { PublicProps } from "../utils/types-utils";
import { WithCssColors } from "../utils/color";
/**
* The Anim component allows an entity to play animations.
* GLB's and GLTF's often contain animations. When you attach this component to an entity,
* it will automatically animate them. You'll also need a Render component to display the entity.
*
* @param {AnimProps} props - The props to pass to the animation component.
* @see https://api.playcanvas.com/engine/classes/AnimComponent.html
*
* @example
* <Entity>
* <Render type="asset" asset={asset} />
* <Anim asset={asset} clip="Walk" loop />
* </Entity>
*/
export declare const Anim: FC<AnimProps>;
interface AnimProps extends Partial<WithCssColors<PublicProps<AnimComponent>>> {
/**
* The asset containing the animations to play. Setting this prop will automatically assign the animations to the component.
* @type {Asset}
*/
asset: Asset;
}
export {};