babylonjs-addons 8.8.4 → 8.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ declare module ADDONS {
6
6
  * Abstract Node class from Babylon.js
7
7
  */
8
8
  export interface INodeLike {
9
- getWorldMatrix(): BABYLON.ThinMatrix;
9
+ getWorldMatrix(): BABYLON.IMatrixLike;
10
10
  }
11
11
  /**
12
12
  * Class used to render text using MSDF (Multi-channel Signed Distance Field) technique
@@ -16,6 +16,7 @@ declare module ADDONS {
16
16
  * With metrics: #6RLCWP#35
17
17
  * Thickness: #IABMEZ#3
18
18
  * Solar system: #9YCDYC#9
19
+ * Stroke: #6RLCWP#37
19
20
  */
20
21
  export class TextRenderer implements BABYLON.IDisposable {
21
22
  private readonly _useVAO;
@@ -42,11 +43,22 @@ declare module ADDONS {
42
43
  private _finalMatrix;
43
44
  private _lineMatrix;
44
45
  private _parentWorldMatrix;
45
- private _storedTranslation;
46
46
  /**
47
47
  * Gets or sets the color of the text
48
48
  */
49
49
  color: BABYLON.IColor4Like;
50
+ /**
51
+ * Gets or sets the color of the stroke around the text
52
+ */
53
+ strokeColor: BABYLON.IColor4Like;
54
+ /**
55
+ * Gets or sets the width of the stroke around the text (inset)
56
+ */
57
+ strokeInsetWidth: number;
58
+ /**
59
+ * Gets or sets the width of the stroke around the text (outset)
60
+ */
61
+ strokeOutsetWidth: number;
50
62
  /**
51
63
  * Gets or sets the thickness of the text (0 means as defined in the font)
52
64
  * Value must be between -0.5 and 0.5
@@ -58,14 +70,32 @@ declare module ADDONS {
58
70
  */
59
71
  get parent(): BABYLON.Nullable<INodeLike>;
60
72
  set parent(value: BABYLON.Nullable<INodeLike>);
73
+ private _transformMatrix;
74
+ /**
75
+ * Gets or sets the transform matrix of the text renderer
76
+ * It will be applied in that order:
77
+ * parent x transform x paragraph world
78
+ */
79
+ get transformMatrix(): BABYLON.IMatrixLike;
80
+ set transformMatrix(value: BABYLON.IMatrixLike);
61
81
  /**
62
82
  * Gets or sets if the text is billboarded
63
83
  */
64
84
  isBillboard: boolean;
85
+ /**
86
+ * Gets or sets if the text is screen projected
87
+ * This will work only if the text is billboarded
88
+ */
89
+ isBillboardScreenProjected: boolean;
65
90
  /**
66
91
  * Gets the number of characters in the text renderer
67
92
  */
68
93
  get characterCount(): number;
94
+ /**
95
+ * Gets or sets if the text renderer should ignore the depth buffer
96
+ * Default is false
97
+ */
98
+ ignoreDepthBuffer: boolean;
69
99
  private constructor();
70
100
  private _resizeBuffers;
71
101
  private _setShaders;
@@ -104,7 +134,7 @@ declare module ADDONS {
104
134
  tabSize: number;
105
135
  whiteSpace: "pre-line";
106
136
  textAlign: "left" | "right" | "center";
107
- translate: BABYLON.Vector2 | undefined;
137
+ translate: BABYLON.IVector2Like | undefined;
108
138
  };
109
139
  /** @internal */
110
140
  export var DefaultParagraphOptions: ParagraphOptions;
@@ -115,7 +145,7 @@ declare module ADDONS {
115
145
  /**
116
146
  * Class representing a font asset for SDF (Signed Distance Field) rendering.
117
147
  */
118
- export class FontAsset {
148
+ export class FontAsset implements BABYLON.IDisposable {
119
149
  private readonly _chars;
120
150
  private readonly _charsRegex;
121
151
  private readonly _kernings;
@@ -133,8 +163,10 @@ declare module ADDONS {
133
163
  * Creates a new FontAsset instance.
134
164
  * @param definitionData defines the font data in JSON format.
135
165
  * @param textureUrl defines the url of the texture to use for the font.
166
+ * @param scene defines the hosting scene.
136
167
  */
137
- constructor(definitionData: string, textureUrl: string);
168
+ constructor(definitionData: string, textureUrl: string, scene?: BABYLON.Scene);
169
+ dispose(): void;
138
170
  private _updateFallbacks;
139
171
  /** @internal */
140
172
  _getChar(charCode: number): BMFontChar;
@@ -146,14 +178,16 @@ declare module ADDONS {
146
178
 
147
179
 
148
180
  /** @internal */
149
- export var msdfVertexShader: {
181
+ export var msdfVertexShaderWGSL: {
150
182
  name: string;
151
183
  shader: string;
152
184
  };
153
185
 
154
186
 
187
+
188
+
155
189
  /** @internal */
156
- export var msdfFragmentShader: {
190
+ export var msdfFragmentShaderWGSL: {
157
191
  name: string;
158
192
  shader: string;
159
193
  };
@@ -166,6 +200,8 @@ declare module ADDONS {
166
200
  };
167
201
 
168
202
 
203
+
204
+
169
205
  /** @internal */
170
206
  export var msdfFragmentShader: {
171
207
  name: string;
@@ -202,6 +238,8 @@ declare module ADDONS {
202
238
  };
203
239
 
204
240
 
241
+
242
+
205
243
  /** @internal */
206
244
  export type SdfGlyph = {
207
245
  char: BMFontChar;