Function CreateText
-
CreateText(
name: string,
text: string,
fontData: IFontData,
options?: {
depth?: number;
faceColors?: Color4[];
faceUV?: Vector4[];
perLetterFaceColors?: (letterIndex: number) => Color4[];
perLetterFaceUV?: (letterIndex: number) => Vector4[];
resolution?: number;
sideOrientation?: number;
size?: number;
},
scene?: Nullable<Scene>,
earcutInjection?: any,
): Nullable<Mesh>Parameters
- name: string
defines the name of the mesh
- text: string
defines the text to use to build the mesh
- fontData: IFontData
defines the font data (can be generated with http://gero3.github.io/facetype.js/)
- options: {
depth?: number;
faceColors?: Color4[];
faceUV?: Vector4[];
perLetterFaceColors?: (letterIndex: number) => Color4[];
perLetterFaceUV?: (letterIndex: number) => Vector4[];
resolution?: number;
sideOrientation?: number;
size?: number;
} = ...defines options used to create the mesh
- scene: Nullable<Scene> = null
defines the hosting scene
- earcutInjection: any = earcut
can be used to inject your own earcut reference
Returns Nullable<Mesh>
a new Mesh
- name: string
Create a text mesh