@playcanvas/web-components 0.2.11 → 0.3.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.
- package/LICENSE +1 -1
- package/dist/components/element-component.d.ts +12 -0
- package/dist/components/splat-component.d.ts +13 -0
- package/dist/pwc.cjs +53 -2
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +53 -2
- package/dist/pwc.js.map +1 -1
- package/dist/pwc.min.js +1 -1
- package/dist/pwc.min.js.map +1 -1
- package/dist/pwc.mjs +53 -2
- package/dist/pwc.mjs.map +1 -1
- package/package.json +13 -11
- package/src/components/element-component.ts +26 -0
- package/src/components/rigidbody-component.ts +1 -1
- package/src/components/splat-component.ts +33 -2
package/dist/pwc.js
CHANGED
|
@@ -2120,6 +2120,7 @@
|
|
|
2120
2120
|
this._asset = '';
|
|
2121
2121
|
this._autoWidth = true;
|
|
2122
2122
|
this._color = new playcanvas.Color(1, 1, 1, 1);
|
|
2123
|
+
this._enableMarkup = false;
|
|
2123
2124
|
this._fontSize = 32;
|
|
2124
2125
|
this._lineHeight = 32;
|
|
2125
2126
|
this._pivot = new playcanvas.Vec2(0.5, 0.5);
|
|
@@ -2136,6 +2137,7 @@
|
|
|
2136
2137
|
anchor: this._anchor,
|
|
2137
2138
|
autoWidth: this._autoWidth,
|
|
2138
2139
|
color: this._color,
|
|
2140
|
+
enableMarkup: this._enableMarkup,
|
|
2139
2141
|
fontAsset: AssetElement.get(this._asset).id,
|
|
2140
2142
|
fontSize: this._fontSize,
|
|
2141
2143
|
lineHeight: this._lineHeight,
|
|
@@ -2222,6 +2224,23 @@
|
|
|
2222
2224
|
get color() {
|
|
2223
2225
|
return this._color;
|
|
2224
2226
|
}
|
|
2227
|
+
/**
|
|
2228
|
+
* Sets whether the element component should use markup.
|
|
2229
|
+
* @param value - Whether to enable markup.
|
|
2230
|
+
*/
|
|
2231
|
+
set enableMarkup(value) {
|
|
2232
|
+
this._enableMarkup = value;
|
|
2233
|
+
if (this.component) {
|
|
2234
|
+
this.component.enableMarkup = value;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* Gets whether the element component should use markup.
|
|
2239
|
+
* @returns Whether markup is enabled.
|
|
2240
|
+
*/
|
|
2241
|
+
get enableMarkup() {
|
|
2242
|
+
return this._enableMarkup;
|
|
2243
|
+
}
|
|
2225
2244
|
/**
|
|
2226
2245
|
* Sets the font size of the element component.
|
|
2227
2246
|
* @param value - The font size.
|
|
@@ -2348,6 +2367,7 @@
|
|
|
2348
2367
|
'asset',
|
|
2349
2368
|
'auto-width',
|
|
2350
2369
|
'color',
|
|
2370
|
+
'enable-markup',
|
|
2351
2371
|
'font-size',
|
|
2352
2372
|
'line-height',
|
|
2353
2373
|
'pivot',
|
|
@@ -2372,6 +2392,9 @@
|
|
|
2372
2392
|
case 'color':
|
|
2373
2393
|
this.color = parseColor(newValue);
|
|
2374
2394
|
break;
|
|
2395
|
+
case 'enable-markup':
|
|
2396
|
+
this.enableMarkup = this.hasAttribute(name);
|
|
2397
|
+
break;
|
|
2375
2398
|
case 'font-size':
|
|
2376
2399
|
this.fontSize = Number(newValue);
|
|
2377
2400
|
break;
|
|
@@ -4261,11 +4284,13 @@
|
|
|
4261
4284
|
super('gsplat');
|
|
4262
4285
|
this._asset = '';
|
|
4263
4286
|
this._castShadows = false;
|
|
4287
|
+
this._unified = false;
|
|
4264
4288
|
}
|
|
4265
4289
|
getInitialComponentData() {
|
|
4266
4290
|
return {
|
|
4267
4291
|
asset: AssetElement.get(this._asset),
|
|
4268
|
-
castShadows: this._castShadows
|
|
4292
|
+
castShadows: this._castShadows,
|
|
4293
|
+
unified: this._unified
|
|
4269
4294
|
};
|
|
4270
4295
|
}
|
|
4271
4296
|
/**
|
|
@@ -4310,11 +4335,34 @@
|
|
|
4310
4335
|
get castShadows() {
|
|
4311
4336
|
return this._castShadows;
|
|
4312
4337
|
}
|
|
4338
|
+
/**
|
|
4339
|
+
* Sets whether the splat supports global sorting and LOD streaming. This property can only be
|
|
4340
|
+
* changed when the component is disabled.
|
|
4341
|
+
* @param value - Whether the splat supports global sorting and LOD streaming.
|
|
4342
|
+
*/
|
|
4343
|
+
set unified(value) {
|
|
4344
|
+
if (this.component && this.component.enabled) {
|
|
4345
|
+
console.warn('The "unified" property can only be changed when the component is disabled.');
|
|
4346
|
+
return;
|
|
4347
|
+
}
|
|
4348
|
+
this._unified = value;
|
|
4349
|
+
if (this.component) {
|
|
4350
|
+
this.component.unified = value;
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
/**
|
|
4354
|
+
* Gets whether the splat supports global sorting and LOD streaming.
|
|
4355
|
+
* @returns Whether the splat supports global sorting and LOD streaming.
|
|
4356
|
+
*/
|
|
4357
|
+
get unified() {
|
|
4358
|
+
return this._unified;
|
|
4359
|
+
}
|
|
4313
4360
|
static get observedAttributes() {
|
|
4314
4361
|
return [
|
|
4315
4362
|
...super.observedAttributes,
|
|
4316
4363
|
'asset',
|
|
4317
|
-
'cast-shadows'
|
|
4364
|
+
'cast-shadows',
|
|
4365
|
+
'unified'
|
|
4318
4366
|
];
|
|
4319
4367
|
}
|
|
4320
4368
|
attributeChangedCallback(name, _oldValue, newValue) {
|
|
@@ -4326,6 +4374,9 @@
|
|
|
4326
4374
|
case 'cast-shadows':
|
|
4327
4375
|
this.castShadows = this.hasAttribute('cast-shadows');
|
|
4328
4376
|
break;
|
|
4377
|
+
case 'unified':
|
|
4378
|
+
this.unified = this.hasAttribute('unified');
|
|
4379
|
+
break;
|
|
4329
4380
|
}
|
|
4330
4381
|
}
|
|
4331
4382
|
}
|