@playcanvas/web-components 0.1.4 → 0.1.6
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/README.md +43 -61
- package/dist/app.d.ts +56 -5
- package/dist/asset.d.ts +0 -1
- package/dist/async-element.d.ts +23 -0
- package/dist/components/camera-component.d.ts +3 -0
- package/dist/components/component.d.ts +4 -2
- package/dist/components/element-component.d.ts +1 -1
- package/dist/components/render-component.d.ts +2 -2
- package/dist/components/script-component.d.ts +1 -1
- package/dist/components/sound-component.d.ts +48 -0
- package/dist/components/sound-slot.d.ts +2 -1
- package/dist/entity.d.ts +2 -3
- package/dist/index.d.ts +10 -1
- package/dist/model.d.ts +2 -1
- package/dist/pwc.cjs +426 -141
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +426 -141
- 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 +427 -143
- package/dist/pwc.mjs.map +1 -1
- package/dist/scene.d.ts +2 -1
- package/dist/sky.d.ts +15 -6
- package/package.json +9 -8
- package/src/app.ts +103 -17
- package/src/asset.ts +1 -3
- package/src/async-element.ts +45 -0
- package/src/components/camera-component.ts +22 -1
- package/src/components/component.ts +15 -26
- package/src/components/element-component.ts +15 -4
- package/src/components/render-component.ts +1 -6
- package/src/components/script-component.ts +25 -7
- package/src/components/sound-component.ts +110 -1
- package/src/components/sound-slot.ts +7 -10
- package/src/entity.ts +19 -29
- package/src/index.ts +11 -0
- package/src/model.ts +20 -15
- package/src/module.ts +18 -10
- package/src/scene.ts +6 -11
- package/src/sky.ts +82 -40
package/README.md
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
# PlayCanvas Web Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@playcanvas/web-components)
|
|
4
|
+
[](https://npmtrends.com/@playcanvas/web-components)
|
|
5
|
+
[](https://github.com/playcanvas/web-components/blob/main/LICENSE)
|
|
6
|
+
[](https://github.com/playcanvas/web-components/actions/workflows/deploy.yml)
|
|
7
|
+
|
|
8
|
+
PlayCanvas Web Components are a set of custom HTML elements for building 3D interactive web apps. Using the declarative nature of HTML makes it both easy and fun to incorporate 3D into your website.
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<!-- A lit sphere -->
|
|
12
|
+
<pc-app>
|
|
13
|
+
<pc-scene>
|
|
14
|
+
<pc-entity name="camera" position="0,0,3">
|
|
15
|
+
<pc-camera></pc-camera>
|
|
16
|
+
</pc-entity>
|
|
17
|
+
<pc-entity name="light" rotation="45,45,0">
|
|
18
|
+
<pc-light></pc-light>
|
|
19
|
+
</pc-entity>
|
|
20
|
+
<pc-entity name="ball">
|
|
21
|
+
<pc-render type="sphere"></pc-render>
|
|
22
|
+
</pc-entity>
|
|
23
|
+
</pc-scene>
|
|
24
|
+
</pc-app>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
[](https://playcanvas.github.io/web-components/examples)
|
|
30
|
+
|
|
31
|
+
See PlayCanvas Web Components in action here: https://playcanvas.github.io/web-components/examples
|
|
4
32
|
|
|
5
33
|
## Usage 🚧
|
|
6
34
|
|
|
@@ -15,13 +43,13 @@ Or you can include it directly in your HTML file from a CDN.
|
|
|
15
43
|
ES Modules:
|
|
16
44
|
|
|
17
45
|
```html
|
|
18
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.
|
|
46
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.5/dist/pwc.mjs"></script>
|
|
19
47
|
```
|
|
20
48
|
|
|
21
49
|
UMD:
|
|
22
50
|
|
|
23
51
|
```html
|
|
24
|
-
<script src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.
|
|
52
|
+
<script src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.5"></script>
|
|
25
53
|
```
|
|
26
54
|
|
|
27
55
|
## Tag Reference 📖
|
|
@@ -54,7 +82,11 @@ The `pc-app` tag is the root element for your PlayCanvas application. It is used
|
|
|
54
82
|
|
|
55
83
|
| Attribute | Description |
|
|
56
84
|
| --- | --- |
|
|
57
|
-
| `
|
|
85
|
+
| `alpha` | Boolean attribute. Determines whether the application allocates an alpha channel in the frame buffer. Defaults to `true`. |
|
|
86
|
+
| `antialias` | Boolean attribute. Determines whether the application uses anti-aliasing. Defaults to `true`. |
|
|
87
|
+
| `depth` | Boolean attribute. Determines whether the application allocates a depth buffer. Defaults to `true`. |
|
|
88
|
+
| `high-resolution` | Boolean attribute. Determines whether the application renders using physical resolution or CSS resolution. Defaults to `true`. |
|
|
89
|
+
| `stencil` | Boolean attribute. Determines whether the application allocates a stencil buffer. Defaults to `true`. |
|
|
58
90
|
|
|
59
91
|
### pc-asset
|
|
60
92
|
|
|
@@ -243,10 +275,12 @@ The `pc-sky` tag is used to define a sky component. It must be a direct child of
|
|
|
243
275
|
| Attribute | Description |
|
|
244
276
|
| --- | --- |
|
|
245
277
|
| `asset` | A string that should match the `id` of a `pc-asset` tag that has a type of `texture`. |
|
|
278
|
+
| `center` | The center of the sky. Specified as a comma-separated list of X, Y, and Z values in the range 0 to 1. If not specified, `0,0.01,0` is used. |
|
|
246
279
|
| `intensity` | The intensity of the sky. If not specified, `1` is used. |
|
|
247
280
|
| `level` | The mipmap level used to render the sky. If not specified, `0` is used (base mip level). |
|
|
248
281
|
| `rotation` | The rotation of the sky. Specified as a comma-separated list of X, Y, and Z values. If not specified, `0,0,0` is used. |
|
|
249
|
-
| `
|
|
282
|
+
| `scale` | The scale of the sky. Specified as a comma-separated list of X, Y, and Z values. If not specified, `100,100,100` is used. |
|
|
283
|
+
| `type` | The type of sky component. Can be `box`, `dome`, `infinite` or `none`. |
|
|
250
284
|
|
|
251
285
|
### pc-sound
|
|
252
286
|
|
|
@@ -270,8 +304,12 @@ The `pc-sounds` tag is used to define a sound component. It must be a direct chi
|
|
|
270
304
|
|
|
271
305
|
| Attribute | Description |
|
|
272
306
|
| --- | --- |
|
|
307
|
+
| `distance-model` | The distance model of the sound. Can be `exponential`, `inverse` or `linear`. If not specified, `linear` is used. |
|
|
273
308
|
| `pitch` | The pitch of the sound. If not specified, `1` is used. |
|
|
309
|
+
| `max-distance` | The maximum distance from the listener at which audio falloff stops. If not specified, `10000` is used. |
|
|
274
310
|
| `positional` | Valueless attribute. If present, the sound is positional. |
|
|
311
|
+
| `ref-distance` | The distance from the listener at which the volume will be at full volume. If not specified, `1` is used. |
|
|
312
|
+
| `roll-off-factor` | The factor used in the falloff equation. If not specified, `1` is used. |
|
|
275
313
|
| `volume` | The volume of the sound. If not specified, `1` is used. |
|
|
276
314
|
|
|
277
315
|
### pc-splat
|
|
@@ -282,59 +320,3 @@ The `pc-splat` tag is used to define a splat component. It must be a direct chil
|
|
|
282
320
|
| --- | --- |
|
|
283
321
|
| `asset` | A string that should match the `id` of a `pc-asset` tag that has a type of `gsplat`. |
|
|
284
322
|
| `enabled` | Enabled state of the splat component. If not specified, `true` is used. |
|
|
285
|
-
|
|
286
|
-
## Example
|
|
287
|
-
|
|
288
|
-
Below is a basic example of how to use PlayCanvas Web Components to create a simple 3D scene (a spinning cube):
|
|
289
|
-
|
|
290
|
-
```html
|
|
291
|
-
<!DOCTYPE html>
|
|
292
|
-
<html lang="en">
|
|
293
|
-
<head>
|
|
294
|
-
<meta charset="UTF-8">
|
|
295
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
296
|
-
<title>PlayCanvas Web Components - Spinning Cube</title>
|
|
297
|
-
<script type="importmap">
|
|
298
|
-
{
|
|
299
|
-
"imports": {
|
|
300
|
-
"playcanvas": "https://esm.run/playcanvas@2.1.0"
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
</script>
|
|
304
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/web-components@0.1.0/dist/pwc.mjs"></script>
|
|
305
|
-
<link rel="stylesheet" href="styles.css">
|
|
306
|
-
</head>
|
|
307
|
-
<body>
|
|
308
|
-
<pc-app>
|
|
309
|
-
<script type="module">
|
|
310
|
-
import { registerScript, Script } from 'playcanvas';
|
|
311
|
-
|
|
312
|
-
class Rotate extends Script {
|
|
313
|
-
update(dt) {
|
|
314
|
-
this.entity.rotate(10 * dt, 20 * dt, 30 * dt);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
registerScript(Rotate, 'rotate');
|
|
319
|
-
</script>
|
|
320
|
-
<pc-scene>
|
|
321
|
-
<!-- Camera -->
|
|
322
|
-
<pc-entity name="camera" position="0,0,3">
|
|
323
|
-
<pc-camera clear-color="#8099e6"></pc-camera>
|
|
324
|
-
</pc-entity>
|
|
325
|
-
<!-- Light -->
|
|
326
|
-
<pc-entity name="light" rotation="45,0,0">
|
|
327
|
-
<pc-light></pc-light>
|
|
328
|
-
</pc-entity>
|
|
329
|
-
<!-- Cube -->
|
|
330
|
-
<pc-entity name="cube">
|
|
331
|
-
<pc-render type="box"></pc-render>
|
|
332
|
-
<pc-scripts>
|
|
333
|
-
<pc-script name="rotate"></pc-script>
|
|
334
|
-
</pc-scripts>
|
|
335
|
-
</pc-entity>
|
|
336
|
-
</pc-scene>
|
|
337
|
-
</pc-app>
|
|
338
|
-
</body>
|
|
339
|
-
</html>
|
|
340
|
-
```
|
package/dist/app.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Application } from 'playcanvas';
|
|
2
|
+
import { AsyncElement } from './async-element';
|
|
2
3
|
/**
|
|
3
4
|
* The main application element.
|
|
4
5
|
*/
|
|
5
|
-
declare class AppElement extends
|
|
6
|
+
declare class AppElement extends AsyncElement {
|
|
6
7
|
/**
|
|
7
8
|
* The canvas element.
|
|
8
9
|
*/
|
|
9
10
|
private _canvas;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
11
|
+
private _alpha;
|
|
12
|
+
private _antialias;
|
|
13
|
+
private _depth;
|
|
14
|
+
private _stencil;
|
|
12
15
|
private _highResolution;
|
|
13
16
|
/**
|
|
14
17
|
* The PlayCanvas application instance.
|
|
@@ -20,11 +23,59 @@ declare class AppElement extends HTMLElement {
|
|
|
20
23
|
constructor();
|
|
21
24
|
connectedCallback(): Promise<void>;
|
|
22
25
|
disconnectedCallback(): void;
|
|
23
|
-
getApplication(): Promise<Application>;
|
|
24
26
|
_onWindowResize(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the alpha flag.
|
|
29
|
+
* @param value - The alpha flag.
|
|
30
|
+
*/
|
|
31
|
+
set alpha(value: boolean);
|
|
32
|
+
/**
|
|
33
|
+
* Gets the alpha flag.
|
|
34
|
+
* @returns The alpha flag.
|
|
35
|
+
*/
|
|
36
|
+
get alpha(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the antialias flag.
|
|
39
|
+
* @param value - The antialias flag.
|
|
40
|
+
*/
|
|
41
|
+
set antialias(value: boolean);
|
|
42
|
+
/**
|
|
43
|
+
* Gets the antialias flag.
|
|
44
|
+
* @returns The antialias flag.
|
|
45
|
+
*/
|
|
46
|
+
get antialias(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the depth flag.
|
|
49
|
+
* @param value - The depth flag.
|
|
50
|
+
*/
|
|
51
|
+
set depth(value: boolean);
|
|
52
|
+
/**
|
|
53
|
+
* Gets the depth flag.
|
|
54
|
+
* @returns The depth flag.
|
|
55
|
+
*/
|
|
56
|
+
get depth(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the high resolution flag. When true, the application will render at the device's
|
|
59
|
+
* physical resolution. When false, the application will render at CSS resolution.
|
|
60
|
+
* @param value - The high resolution flag.
|
|
61
|
+
*/
|
|
25
62
|
set highResolution(value: boolean);
|
|
63
|
+
/**
|
|
64
|
+
* Gets the high resolution flag.
|
|
65
|
+
* @returns The high resolution flag.
|
|
66
|
+
*/
|
|
26
67
|
get highResolution(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the stencil flag.
|
|
70
|
+
* @param value - The stencil flag.
|
|
71
|
+
*/
|
|
72
|
+
set stencil(value: boolean);
|
|
73
|
+
/**
|
|
74
|
+
* Gets the stencil flag.
|
|
75
|
+
* @returns The stencil flag.
|
|
76
|
+
*/
|
|
77
|
+
get stencil(): boolean;
|
|
27
78
|
static get observedAttributes(): string[];
|
|
28
|
-
attributeChangedCallback(name: string, _oldValue: string,
|
|
79
|
+
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
|
|
29
80
|
}
|
|
30
81
|
export { AppElement };
|
package/dist/asset.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AppElement } from './app';
|
|
2
|
+
import { EntityElement } from './entity';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all PlayCanvas web components that initialize asynchronously.
|
|
5
|
+
*/
|
|
6
|
+
declare class AsyncElement extends HTMLElement {
|
|
7
|
+
private _readyPromise;
|
|
8
|
+
private _readyResolve;
|
|
9
|
+
constructor();
|
|
10
|
+
get closestApp(): AppElement;
|
|
11
|
+
get closestEntity(): EntityElement;
|
|
12
|
+
/**
|
|
13
|
+
* Called when the element is fully initialized and ready.
|
|
14
|
+
* Subclasses should call this when they're ready.
|
|
15
|
+
*/
|
|
16
|
+
protected _onReady(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a promise that resolves with this element when it's ready.
|
|
19
|
+
* @returns A promise that resolves with this element when it's ready.
|
|
20
|
+
*/
|
|
21
|
+
ready(): Promise<this>;
|
|
22
|
+
}
|
|
23
|
+
export { AsyncElement };
|
|
@@ -42,6 +42,9 @@ declare class CameraComponentElement extends ComponentElement {
|
|
|
42
42
|
rect: Vec4;
|
|
43
43
|
scissorRect: Vec4;
|
|
44
44
|
};
|
|
45
|
+
get xrAvailable(): boolean | null | undefined;
|
|
46
|
+
startXr(type: 'immersive-ar' | 'immersive-vr', space: 'bounded-floor' | 'local' | 'local-floor' | 'unbounded' | 'viewer'): void;
|
|
47
|
+
endXr(): void;
|
|
45
48
|
/**
|
|
46
49
|
* Gets the camera component.
|
|
47
50
|
* @returns The camera component.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Component } from 'playcanvas';
|
|
2
|
+
import { AsyncElement } from '../async-element';
|
|
2
3
|
/**
|
|
3
4
|
* Represents a component in the PlayCanvas engine.
|
|
4
5
|
*
|
|
5
6
|
* @category Components
|
|
6
7
|
*/
|
|
7
|
-
declare class ComponentElement extends
|
|
8
|
+
declare class ComponentElement extends AsyncElement {
|
|
8
9
|
private _componentName;
|
|
9
10
|
private _enabled;
|
|
10
11
|
private _component;
|
|
@@ -14,8 +15,9 @@ declare class ComponentElement extends HTMLElement {
|
|
|
14
15
|
*/
|
|
15
16
|
constructor(componentName: string);
|
|
16
17
|
getInitialComponentData(): {};
|
|
18
|
+
addComponent(): Promise<void>;
|
|
19
|
+
initComponent(): void;
|
|
17
20
|
connectedCallback(): Promise<void>;
|
|
18
|
-
addComponent(): void;
|
|
19
21
|
disconnectedCallback(): void;
|
|
20
22
|
get component(): Component | null;
|
|
21
23
|
/**
|
|
@@ -18,7 +18,7 @@ declare class ElementComponentElement extends ComponentElement {
|
|
|
18
18
|
private _width;
|
|
19
19
|
private _wrapLines;
|
|
20
20
|
constructor();
|
|
21
|
-
|
|
21
|
+
initComponent(): void;
|
|
22
22
|
getInitialComponentData(): {
|
|
23
23
|
anchor: Vec4;
|
|
24
24
|
autoWidth: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderComponent } from 'playcanvas';
|
|
1
|
+
import { RenderComponent, StandardMaterial } from 'playcanvas';
|
|
2
2
|
import { ComponentElement } from './component';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a render component in the PlayCanvas engine.
|
|
@@ -11,10 +11,10 @@ declare class RenderComponentElement extends ComponentElement {
|
|
|
11
11
|
private _receiveShadows;
|
|
12
12
|
private _type;
|
|
13
13
|
constructor();
|
|
14
|
-
connectedCallback(): Promise<void>;
|
|
15
14
|
getInitialComponentData(): {
|
|
16
15
|
type: "box" | "asset" | "capsule" | "cone" | "cylinder" | "plane" | "sphere";
|
|
17
16
|
castShadows: boolean;
|
|
17
|
+
material: StandardMaterial | null | undefined;
|
|
18
18
|
receiveShadows: boolean;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
@@ -24,7 +24,7 @@ declare global {
|
|
|
24
24
|
declare class ScriptComponentElement extends ComponentElement {
|
|
25
25
|
private observer;
|
|
26
26
|
constructor();
|
|
27
|
-
|
|
27
|
+
initComponent(): void;
|
|
28
28
|
private applyAttributes;
|
|
29
29
|
private handleScriptAttributesChange;
|
|
30
30
|
private handleScriptEnableChange;
|
|
@@ -6,13 +6,21 @@ import { ComponentElement } from './component';
|
|
|
6
6
|
* @category Components
|
|
7
7
|
*/
|
|
8
8
|
declare class SoundComponentElement extends ComponentElement {
|
|
9
|
+
private _distanceModel;
|
|
10
|
+
private _maxDistance;
|
|
9
11
|
private _pitch;
|
|
10
12
|
private _positional;
|
|
13
|
+
private _refDistance;
|
|
14
|
+
private _rollOffFactor;
|
|
11
15
|
private _volume;
|
|
12
16
|
constructor();
|
|
13
17
|
getInitialComponentData(): {
|
|
18
|
+
distanceModel: "exponential" | "inverse" | "linear";
|
|
19
|
+
maxDistance: number;
|
|
14
20
|
pitch: number;
|
|
15
21
|
positional: boolean;
|
|
22
|
+
refDistance: number;
|
|
23
|
+
rollOffFactor: number;
|
|
16
24
|
volume: number;
|
|
17
25
|
};
|
|
18
26
|
/**
|
|
@@ -20,6 +28,26 @@ declare class SoundComponentElement extends ComponentElement {
|
|
|
20
28
|
* @returns The sound component.
|
|
21
29
|
*/
|
|
22
30
|
get component(): SoundComponent | null;
|
|
31
|
+
/**
|
|
32
|
+
* Sets which algorithm to use to reduce the volume of the sound as it moves away from the listener.
|
|
33
|
+
* @param value - The distance model.
|
|
34
|
+
*/
|
|
35
|
+
set distanceModel(value: 'exponential' | 'inverse' | 'linear');
|
|
36
|
+
/**
|
|
37
|
+
* Gets which algorithm to use to reduce the volume of the sound as it moves away from the listener.
|
|
38
|
+
* @returns The distance model.
|
|
39
|
+
*/
|
|
40
|
+
get distanceModel(): 'exponential' | 'inverse' | 'linear';
|
|
41
|
+
/**
|
|
42
|
+
* Sets the maximum distance from the listener at which audio falloff stops.
|
|
43
|
+
* @param value - The max distance.
|
|
44
|
+
*/
|
|
45
|
+
set maxDistance(value: number);
|
|
46
|
+
/**
|
|
47
|
+
* Gets the maximum distance from the listener at which audio falloff stops.
|
|
48
|
+
* @returns The max distance.
|
|
49
|
+
*/
|
|
50
|
+
get maxDistance(): number;
|
|
23
51
|
/**
|
|
24
52
|
* Sets the pitch of the sound.
|
|
25
53
|
* @param value - The pitch.
|
|
@@ -40,6 +68,26 @@ declare class SoundComponentElement extends ComponentElement {
|
|
|
40
68
|
* @returns The positional flag.
|
|
41
69
|
*/
|
|
42
70
|
get positional(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Sets the reference distance for reducing volume as the sound source moves further from the listener. Defaults to 1.
|
|
73
|
+
* @param value - The ref distance.
|
|
74
|
+
*/
|
|
75
|
+
set refDistance(value: number);
|
|
76
|
+
/**
|
|
77
|
+
* Gets the reference distance for reducing volume as the sound source moves further from the listener.
|
|
78
|
+
* @returns The ref distance.
|
|
79
|
+
*/
|
|
80
|
+
get refDistance(): number;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the factor used in the falloff equation. Defaults to 1.
|
|
83
|
+
* @param value - The roll-off factor.
|
|
84
|
+
*/
|
|
85
|
+
set rollOffFactor(value: number);
|
|
86
|
+
/**
|
|
87
|
+
* Gets the factor used in the falloff equation.
|
|
88
|
+
* @returns The roll-off factor.
|
|
89
|
+
*/
|
|
90
|
+
get rollOffFactor(): number;
|
|
43
91
|
/**
|
|
44
92
|
* Sets the volume of the sound.
|
|
45
93
|
* @param value - The volume.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SoundSlot } from 'playcanvas';
|
|
2
|
+
import { AsyncElement } from '../async-element';
|
|
2
3
|
import { SoundComponentElement } from './sound-component';
|
|
3
4
|
/**
|
|
4
5
|
* Represents a sound slot in the PlayCanvas engine.
|
|
5
6
|
*/
|
|
6
|
-
declare class SoundSlotElement extends
|
|
7
|
+
declare class SoundSlotElement extends AsyncElement {
|
|
7
8
|
private _asset;
|
|
8
9
|
private _autoPlay;
|
|
9
10
|
private _duration;
|
package/dist/entity.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Entity, Vec3 } from 'playcanvas';
|
|
2
|
+
import { AsyncElement } from './async-element';
|
|
2
3
|
/**
|
|
3
4
|
* Represents an entity in the PlayCanvas engine.
|
|
4
5
|
*/
|
|
5
|
-
declare class EntityElement extends
|
|
6
|
+
declare class EntityElement extends AsyncElement {
|
|
6
7
|
/**
|
|
7
8
|
* Whether the entity is enabled.
|
|
8
9
|
*/
|
|
@@ -27,8 +28,6 @@ declare class EntityElement extends HTMLElement {
|
|
|
27
28
|
* The tags of the entity.
|
|
28
29
|
*/
|
|
29
30
|
private _tags;
|
|
30
|
-
private _resolveEntity;
|
|
31
|
-
private _entityReady;
|
|
32
31
|
/**
|
|
33
32
|
* The PlayCanvas entity instance.
|
|
34
33
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Engine Web Components module provides a set of Web Components for the PlayCanvas Engine.
|
|
3
|
+
* While these components are normally instantiated in a declarative fashion using HTML, this
|
|
4
|
+
* reference covers the TypeScript/JavaScript API that allows these components to be created
|
|
5
|
+
* programmatically.
|
|
6
|
+
*
|
|
7
|
+
* @module EngineWebComponents
|
|
8
|
+
*/
|
|
9
|
+
import { AsyncElement } from './async-element';
|
|
1
10
|
import { ModuleElement } from './module';
|
|
2
11
|
import { AppElement } from './app';
|
|
3
12
|
import { EntityElement } from './entity';
|
|
@@ -20,4 +29,4 @@ import { MaterialElement } from './material';
|
|
|
20
29
|
import { ModelElement } from './model';
|
|
21
30
|
import { SceneElement } from './scene';
|
|
22
31
|
import { SkyElement } from './sky';
|
|
23
|
-
export { ModuleElement, AppElement, EntityElement, AssetElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, GSplatComponentElement, LightComponentElement, ListenerComponentElement, RenderComponentElement, RigidBodyComponentElement, ScreenComponentElement, ScriptComponentElement, ScriptElement, SoundComponentElement, SoundSlotElement, MaterialElement, ModelElement, SceneElement, SkyElement };
|
|
32
|
+
export { AsyncElement, ModuleElement, AppElement, EntityElement, AssetElement, CameraComponentElement, CollisionComponentElement, ComponentElement, ElementComponentElement, GSplatComponentElement, LightComponentElement, ListenerComponentElement, RenderComponentElement, RigidBodyComponentElement, ScreenComponentElement, ScriptComponentElement, ScriptElement, SoundComponentElement, SoundSlotElement, MaterialElement, ModelElement, SceneElement, SkyElement };
|
package/dist/model.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { AsyncElement } from './async-element';
|
|
1
2
|
/**
|
|
2
3
|
* Represents a model in the PlayCanvas engine.
|
|
3
4
|
*/
|
|
4
|
-
declare class ModelElement extends
|
|
5
|
+
declare class ModelElement extends AsyncElement {
|
|
5
6
|
private _asset;
|
|
6
7
|
connectedCallback(): Promise<void>;
|
|
7
8
|
_loadModel(): void;
|