@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
27 lines (26 loc) • 996 B
TypeScript
import { FC } from "react";
import { AnimComponent, Asset } from "playcanvas";
import { PublicProps, Serializable } from "../utils/types-utils";
/**
* 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<Serializable<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 {};