1
1
import { Component , computed , CUSTOM_ELEMENTS_SCHEMA , Input } from '@angular/core' ;
2
2
import { toObservable , toSignal } from '@angular/core/rxjs-interop' ;
3
- import { extend , NgtArgs , NgtSignalStore , type NgtMesh } from 'angular-three' ;
3
+ import { extend , injectNgtRef , NgtArgs , NgtSignalStore , type NgtMesh } from 'angular-three' ;
4
4
import { map , of , switchMap } from 'rxjs' ;
5
5
import { Mesh } from 'three' ;
6
6
import { FontLoader , TextGeometry } from 'three-stdlib' ;
@@ -30,6 +30,7 @@ export type NgtsText3DState = {
30
30
bevelOffset : number ;
31
31
bevelSegments : number ;
32
32
curveSegments : number ;
33
+ smooth ?: number ;
33
34
} ;
34
35
35
36
declare global {
@@ -42,7 +43,7 @@ declare global {
42
43
selector : 'ngts-text-3d' ,
43
44
standalone : true ,
44
45
template : `
45
- <ngt-mesh ngtCompound>
46
+ <ngt-mesh ngtCompound [ref]="textRef" >
46
47
<ngt-text-geometry *args="geometryArgs()" />
47
48
<ng-content />
48
49
</ngt-mesh>
@@ -51,6 +52,8 @@ declare global {
51
52
schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
52
53
} )
53
54
export class NgtsText3D extends NgtSignalStore < NgtsText3DState > {
55
+ @Input ( ) textRef = injectNgtRef < Mesh > ( ) ;
56
+
54
57
@Input ( { required : true } ) set font ( font : FontData | string ) {
55
58
this . set ( { font } ) ;
56
59
}
@@ -99,6 +102,10 @@ export class NgtsText3D extends NgtSignalStore<NgtsText3DState> {
99
102
this . set ( { letterSpacing } ) ;
100
103
}
101
104
105
+ @Input ( ) set smooth ( smooth : number ) {
106
+ this . set ( { smooth } ) ;
107
+ }
108
+
102
109
constructor ( ) {
103
110
super ( {
104
111
lineHeight : 1 ,
0 commit comments