@playcanvas/web-components 0.11.1 → 0.13.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/README.md +1 -1
- package/dist/app.d.cts +246 -0
- package/dist/app.d.ts +38 -13
- package/dist/asset.d.cts +218 -0
- package/dist/asset.d.ts +145 -6
- package/dist/async-element.d.cts +103 -0
- package/dist/async-element.d.ts +11 -8
- package/dist/colors.d.cts +1 -0
- package/dist/components/button-component.d.cts +186 -0
- package/dist/components/button-component.d.ts +1 -1
- package/dist/components/camera-component.d.cts +253 -0
- package/dist/components/camera-component.d.ts +1 -1
- package/dist/components/collision-component.d.cts +73 -0
- package/dist/components/collision-component.d.ts +17 -1
- package/dist/components/component.d.cts +82 -0
- package/dist/components/component.d.ts +20 -1
- package/dist/components/element-component.d.cts +316 -0
- package/dist/components/element-component.d.ts +1 -1
- package/dist/components/gsplat-component.d.cts +108 -0
- package/dist/components/gsplat-component.d.ts +1 -1
- package/dist/components/layoutchild-component.d.cts +110 -0
- package/dist/components/layoutchild-component.d.ts +1 -1
- package/dist/components/layoutgroup-component.d.cts +136 -0
- package/dist/components/layoutgroup-component.d.ts +1 -1
- package/dist/components/light-component.d.cts +264 -0
- package/dist/components/light-component.d.ts +1 -1
- package/dist/components/listener-component.d.cts +20 -0
- package/dist/components/listener-component.d.ts +1 -1
- package/dist/components/particlesystem-component.d.cts +52 -0
- package/dist/components/particlesystem-component.d.ts +1 -1
- package/dist/components/render-component.d.cts +76 -0
- package/dist/components/render-component.d.ts +1 -1
- package/dist/components/rigidbody-component.d.cts +88 -0
- package/dist/components/rigidbody-component.d.ts +1 -1
- package/dist/components/screen-component.d.cts +70 -0
- package/dist/components/screen-component.d.ts +1 -1
- package/dist/components/script-component.d.cts +163 -0
- package/dist/components/script-component.d.ts +1 -1
- package/dist/components/script.d.cts +94 -0
- package/dist/components/script.d.ts +1 -1
- package/dist/components/scrollbar-component.d.cts +69 -0
- package/dist/components/scrollbar-component.d.ts +1 -1
- package/dist/components/scrollview-component.d.cts +178 -0
- package/dist/components/scrollview-component.d.ts +1 -1
- package/dist/components/sound-component.d.cts +108 -0
- package/dist/components/sound-component.d.ts +1 -1
- package/dist/components/sound-slot.d.cts +134 -0
- package/dist/components/sound-slot.d.ts +2 -2
- package/dist/custom-elements.json +1127 -179
- package/dist/entity-base.d.cts +67 -0
- package/dist/entity-base.d.ts +67 -0
- package/dist/entity.d.cts +131 -0
- package/dist/entity.d.ts +3 -38
- package/dist/index.d.cts +79 -0
- package/dist/index.d.ts +35 -32
- package/dist/loading-bar.d.cts +35 -0
- package/dist/material.d.cts +1011 -0
- package/dist/material.d.ts +2 -1
- package/dist/model.d.cts +72 -0
- package/dist/model.d.ts +27 -5
- package/dist/module.d.cts +29 -0
- package/dist/module.d.ts +16 -10
- package/dist/node.d.cts +253 -0
- package/dist/node.d.ts +253 -0
- package/dist/parse.d.cts +147 -0
- package/dist/pwc.cjs +1496 -200
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +1497 -201
- 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.min.mjs +1 -1
- package/dist/pwc.min.mjs.map +1 -1
- package/dist/pwc.mjs +1496 -202
- package/dist/pwc.mjs.map +1 -1
- package/dist/scene.d.cts +117 -0
- package/dist/scene.d.ts +1 -1
- package/dist/sky.d.cts +121 -0
- package/dist/sky.d.ts +1 -1
- package/dist/vscode.html-custom-data.json +127 -5
- package/dist/web-types.json +399 -59
- package/package.json +16 -7
- package/src/app.ts +137 -45
- package/src/asset.ts +439 -9
- package/src/async-element.ts +11 -8
- package/src/components/collision-component.ts +35 -0
- package/src/components/component.ts +93 -3
- package/src/entity-base.ts +136 -0
- package/src/entity.ts +23 -117
- package/src/index.ts +5 -0
- package/src/loading-bar.ts +2 -2
- package/src/material.ts +2 -2
- package/src/model.ts +79 -11
- package/src/module.ts +39 -20
- package/src/node.ts +715 -0
- package/src/sky.ts +0 -1
package/dist/scene.d.cts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Scene } from 'playcanvas';
|
|
2
|
+
import { Color, Vec3 } from 'playcanvas';
|
|
3
|
+
import { AsyncElement } from './async-element.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* The SceneElement interface provides properties and methods for manipulating
|
|
6
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scene/ | `<pc-scene>`} elements.
|
|
7
|
+
* The SceneElement interface also inherits the properties and methods of the
|
|
8
|
+
* {@link HTMLElement} interface.
|
|
9
|
+
*/
|
|
10
|
+
declare class SceneElement extends AsyncElement {
|
|
11
|
+
/**
|
|
12
|
+
* The fog type of the scene.
|
|
13
|
+
*/
|
|
14
|
+
private _fog;
|
|
15
|
+
/**
|
|
16
|
+
* The color of the fog.
|
|
17
|
+
*/
|
|
18
|
+
private _fogColor;
|
|
19
|
+
/**
|
|
20
|
+
* The density of the fog.
|
|
21
|
+
*/
|
|
22
|
+
private _fogDensity;
|
|
23
|
+
/**
|
|
24
|
+
* The start distance of the fog.
|
|
25
|
+
*/
|
|
26
|
+
private _fogStart;
|
|
27
|
+
/**
|
|
28
|
+
* The end distance of the fog.
|
|
29
|
+
*/
|
|
30
|
+
private _fogEnd;
|
|
31
|
+
/**
|
|
32
|
+
* The gravity of the scene.
|
|
33
|
+
*/
|
|
34
|
+
private _gravity;
|
|
35
|
+
private _scene;
|
|
36
|
+
/**
|
|
37
|
+
* The PlayCanvas scene instance. `null` until the element is ready — await
|
|
38
|
+
* {@link whenReady} or the element's `ready()` promise before accessing it.
|
|
39
|
+
* @returns The scene instance, or `null`.
|
|
40
|
+
*/
|
|
41
|
+
get scene(): Scene | null;
|
|
42
|
+
connectedCallback(): Promise<void>;
|
|
43
|
+
disconnectedCallback(): void;
|
|
44
|
+
private _updateSceneSettings;
|
|
45
|
+
/**
|
|
46
|
+
* Applies gravity to the rigid body system. Resolved through `closestApp` rather than
|
|
47
|
+
* `parentElement` so that a `<pc-scene>` nested inside a wrapper element behaves the same as
|
|
48
|
+
* a direct child, matching how `connectedCallback` resolves the application.
|
|
49
|
+
*
|
|
50
|
+
* @param value - The gravity to apply.
|
|
51
|
+
*/
|
|
52
|
+
private _applyGravity;
|
|
53
|
+
/**
|
|
54
|
+
* Sets the fog type of the scene. Can be `none`, `linear`, `exp` or `exp2`. Defaults to
|
|
55
|
+
* `none`.
|
|
56
|
+
* @param value - The fog type.
|
|
57
|
+
*/
|
|
58
|
+
set fog(value: "linear" | "none" | "exp" | "exp2");
|
|
59
|
+
/**
|
|
60
|
+
* Gets the fog type of the scene.
|
|
61
|
+
* @returns The fog type.
|
|
62
|
+
*/
|
|
63
|
+
get fog(): "linear" | "none" | "exp" | "exp2";
|
|
64
|
+
/**
|
|
65
|
+
* Sets the fog color of the scene.
|
|
66
|
+
* @param value - The fog color.
|
|
67
|
+
*/
|
|
68
|
+
set fogColor(value: Color);
|
|
69
|
+
/**
|
|
70
|
+
* Gets the fog color of the scene.
|
|
71
|
+
* @returns The fog color.
|
|
72
|
+
*/
|
|
73
|
+
get fogColor(): Color;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the fog density of the scene.
|
|
76
|
+
* @param value - The fog density.
|
|
77
|
+
*/
|
|
78
|
+
set fogDensity(value: number);
|
|
79
|
+
/**
|
|
80
|
+
* Gets the fog density of the scene.
|
|
81
|
+
* @returns The fog density.
|
|
82
|
+
*/
|
|
83
|
+
get fogDensity(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the fog start distance of the scene.
|
|
86
|
+
* @param value - The fog start distance.
|
|
87
|
+
*/
|
|
88
|
+
set fogStart(value: number);
|
|
89
|
+
/**
|
|
90
|
+
* Gets the fog start distance of the scene.
|
|
91
|
+
* @returns The fog start distance.
|
|
92
|
+
*/
|
|
93
|
+
get fogStart(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Sets the fog end distance of the scene.
|
|
96
|
+
* @param value - The fog end distance.
|
|
97
|
+
*/
|
|
98
|
+
set fogEnd(value: number);
|
|
99
|
+
/**
|
|
100
|
+
* Gets the fog end distance of the scene.
|
|
101
|
+
* @returns The fog end distance.
|
|
102
|
+
*/
|
|
103
|
+
get fogEnd(): number;
|
|
104
|
+
/**
|
|
105
|
+
* Sets the gravity of the scene.
|
|
106
|
+
* @param value - The gravity.
|
|
107
|
+
*/
|
|
108
|
+
set gravity(value: Vec3);
|
|
109
|
+
/**
|
|
110
|
+
* Gets the gravity of the scene.
|
|
111
|
+
* @returns The gravity.
|
|
112
|
+
*/
|
|
113
|
+
get gravity(): Vec3;
|
|
114
|
+
static get observedAttributes(): string[];
|
|
115
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
116
|
+
}
|
|
117
|
+
export { SceneElement };
|
package/dist/scene.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Scene } from 'playcanvas';
|
|
2
2
|
import { Color, Vec3 } from 'playcanvas';
|
|
3
|
-
import { AsyncElement } from './async-element';
|
|
3
|
+
import { AsyncElement } from './async-element.js';
|
|
4
4
|
/**
|
|
5
5
|
* The SceneElement interface provides properties and methods for manipulating
|
|
6
6
|
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-scene/ | `<pc-scene>`} elements.
|
package/dist/sky.d.cts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Vec3 } from 'playcanvas';
|
|
2
|
+
import { AsyncElement } from './async-element.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* The SkyElement interface provides properties and methods for manipulating
|
|
5
|
+
* `<pc-sky>` elements. The SkyElement interface also inherits the properties and
|
|
6
|
+
* methods of the {@link HTMLElement} interface.
|
|
7
|
+
*/
|
|
8
|
+
declare class SkyElement extends AsyncElement {
|
|
9
|
+
private _asset;
|
|
10
|
+
private _center;
|
|
11
|
+
private _intensity;
|
|
12
|
+
private _rotation;
|
|
13
|
+
private _mipLevel;
|
|
14
|
+
private _lighting;
|
|
15
|
+
private _scale;
|
|
16
|
+
private _type;
|
|
17
|
+
private _scene;
|
|
18
|
+
private _appElement;
|
|
19
|
+
/**
|
|
20
|
+
* Incremented on every new load and on disconnect, and captured by a load when it starts. A
|
|
21
|
+
* load that resumes from an await or a load callback abandons itself if the value has moved
|
|
22
|
+
* on, so a superseded load cannot generate a skybox for a scene it no longer configures.
|
|
23
|
+
*/
|
|
24
|
+
private _loadGeneration;
|
|
25
|
+
/**
|
|
26
|
+
* The pending asset-load subscription of the current load, if it is waiting for its asset.
|
|
27
|
+
* Held so that whatever supersedes the load can detach the handler from the asset, rather
|
|
28
|
+
* than leave it registered until the asset loads (or forever, if it never does).
|
|
29
|
+
*/
|
|
30
|
+
private _loadHandle;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
private _detachLoadHandler;
|
|
34
|
+
private _generateSkybox;
|
|
35
|
+
private _loadSkybox;
|
|
36
|
+
private _unloadSkybox;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the id of the `pc-asset` to use for the skybox.
|
|
39
|
+
* @param value - The asset ID.
|
|
40
|
+
*/
|
|
41
|
+
set asset(value: string);
|
|
42
|
+
/**
|
|
43
|
+
* Gets the id of the `pc-asset` to use for the skybox.
|
|
44
|
+
* @returns The asset ID.
|
|
45
|
+
*/
|
|
46
|
+
get asset(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the center of the skybox.
|
|
49
|
+
* @param value - The center.
|
|
50
|
+
*/
|
|
51
|
+
set center(value: Vec3);
|
|
52
|
+
/**
|
|
53
|
+
* Gets the center of the skybox.
|
|
54
|
+
* @returns The center.
|
|
55
|
+
*/
|
|
56
|
+
get center(): Vec3;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the intensity of the skybox.
|
|
59
|
+
* @param value - The intensity.
|
|
60
|
+
*/
|
|
61
|
+
set intensity(value: number);
|
|
62
|
+
/**
|
|
63
|
+
* Gets the intensity of the skybox.
|
|
64
|
+
* @returns The intensity.
|
|
65
|
+
*/
|
|
66
|
+
get intensity(): number;
|
|
67
|
+
/**
|
|
68
|
+
* Sets whether the skybox is used as a light source.
|
|
69
|
+
* @param value - Whether to use lighting.
|
|
70
|
+
*/
|
|
71
|
+
set lighting(value: boolean);
|
|
72
|
+
/**
|
|
73
|
+
* Gets whether the skybox is used as a light source.
|
|
74
|
+
* @returns Whether to use lighting.
|
|
75
|
+
*/
|
|
76
|
+
get lighting(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Sets the mip level of the skybox, where 0 is the sharpest. Raising it selects a blurrier mip,
|
|
79
|
+
* which is how a skybox is softened without blurring the texture itself.
|
|
80
|
+
* @param value - The mip level.
|
|
81
|
+
*/
|
|
82
|
+
set mipLevel(value: number);
|
|
83
|
+
/**
|
|
84
|
+
* Gets the mip level of the skybox.
|
|
85
|
+
* @returns The mip level.
|
|
86
|
+
*/
|
|
87
|
+
get mipLevel(): number;
|
|
88
|
+
/**
|
|
89
|
+
* Sets the Euler rotation of the skybox.
|
|
90
|
+
* @param value - The rotation.
|
|
91
|
+
*/
|
|
92
|
+
set rotation(value: Vec3);
|
|
93
|
+
/**
|
|
94
|
+
* Gets the Euler rotation of the skybox.
|
|
95
|
+
* @returns The rotation.
|
|
96
|
+
*/
|
|
97
|
+
get rotation(): Vec3;
|
|
98
|
+
/**
|
|
99
|
+
* Sets the scale of the skybox.
|
|
100
|
+
* @param value - The scale.
|
|
101
|
+
*/
|
|
102
|
+
set scale(value: Vec3);
|
|
103
|
+
/**
|
|
104
|
+
* Gets the scale of the skybox.
|
|
105
|
+
* @returns The scale.
|
|
106
|
+
*/
|
|
107
|
+
get scale(): Vec3;
|
|
108
|
+
/**
|
|
109
|
+
* Sets the type of the skybox.
|
|
110
|
+
* @param value - The type.
|
|
111
|
+
*/
|
|
112
|
+
set type(value: 'box' | 'dome' | 'infinite' | 'none');
|
|
113
|
+
/**
|
|
114
|
+
* Gets the type of the skybox.
|
|
115
|
+
* @returns The type.
|
|
116
|
+
*/
|
|
117
|
+
get type(): "box" | "dome" | "infinite" | "none";
|
|
118
|
+
static get observedAttributes(): string[];
|
|
119
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
120
|
+
}
|
|
121
|
+
export { SkyElement };
|
package/dist/sky.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vec3 } from 'playcanvas';
|
|
2
|
-
import { AsyncElement } from './async-element';
|
|
2
|
+
import { AsyncElement } from './async-element.js';
|
|
3
3
|
/**
|
|
4
4
|
* The SkyElement interface provides properties and methods for manipulating
|
|
5
5
|
* `<pc-sky>` elements. The SkyElement interface also inherits the properties and
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tags": [
|
|
5
5
|
{
|
|
6
6
|
"name": "pc-app",
|
|
7
|
-
"description": "The AppElement interface provides properties and methods for manipulating\n[`<pc-app>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-app/) elements.\nThe AppElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\n---\n\n\n### **Events:**\n - **progress** - Fired while the application preloads its assets. `loaded` and `total` are asset counts, not bytes, and an asset that fails to load still counts as loaded. Fired at least once per boot, and the final event always has `loaded` equal to `total`. Does not bubble.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **elementFromEntity(entity: _Entity_): __** - Returns the `<pc-entity>` element whose backing entity is `entity`, or
|
|
7
|
+
"description": "The AppElement interface provides properties and methods for manipulating\n[`<pc-app>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-app/) elements.\nThe AppElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe element is sized like a replaced element such as `<video>`: a block-level box that the\npage's CSS controls, 300x150 by default. The application's canvas always fills the element,\nand the drawing buffer resolution follows the element's size (capped by `max-pixel-ratio`),\ntracked live via a ResizeObserver — so the element can be embedded at any size, resized by\nits container, or made fullscreen with ordinary CSS such as `width: 100vw; height: 100dvh`.\n\n---\n\n\n### **Events:**\n - **error** - Fired when the application cannot boot because no graphics device could be created (for example, a browser with WebGL disabled). `message` names the requested backends and `error` holds the underlying failure. The element never becomes ready and `app` stays `null` — listen for this event to show a fallback UI. Removing the element and re-inserting it retries the boot with its current attributes. Does not bubble.\n- **progress** - Fired while the application preloads its assets. `loaded` and `total` are asset counts, not bytes, and an asset that fails to load still counts as loaded. Fired at least once per boot, and the final event always has `loaded` equal to `total`. Does not bubble.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **elementFromEntity(entity: _Entity_): __** - Returns the `<pc-entity>` or `<pc-node>` element whose backing entity is `entity`, or\n`null` if the entity is not fronted by an element of this application - for example, an\nunbound node inside a model's instantiated hierarchy, or an entity created through the\nengine API.\n- **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
8
8
|
"attributes": [
|
|
9
9
|
{
|
|
10
10
|
"name": "alpha",
|
|
@@ -50,8 +50,31 @@
|
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"name": "pc-asset",
|
|
53
|
-
"description": "The AssetElement interface provides properties and methods for manipulating\n[`<pc-asset>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-asset/) elements.\nThe AssetElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe element becomes ready once the containing application has started and the asset is in the\nstate declared by the markup: loaded for preloaded assets (even if loading failed — check the\nasset's `resource`), or registered and awaiting a load for `lazy` assets. Elements inserted\nwhile the application is running are created and registered on insertion, and begin loading\nimmediately unless `lazy`. A `pc-asset` must be a direct child of `pc-app` — elements placed\nelsewhere, or with an unsupported asset type, never become ready.\n\nApart from `lazy
|
|
53
|
+
"description": "The AssetElement interface provides properties and methods for manipulating\n[`<pc-asset>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-asset/) elements.\nThe AssetElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe element becomes ready once the containing application has started and the asset is in the\nstate declared by the markup: loaded for preloaded assets (even if loading failed — check the\nasset's `resource`), or registered and awaiting a load for `lazy` assets. Elements inserted\nwhile the application is running are created and registered on insertion, and begin loading\nimmediately unless `lazy`. A `pc-asset` must be a direct child of `pc-app` — elements placed\nelsewhere, or with an unsupported asset type, never become ready.\n\nFor `texture` and `textureatlas` assets, the texture options (`address-u`, `address-v`,\n`min-filter`, `mag-filter`, `anisotropy`, `mipmaps`, `srgb`, `flip-y`) apply when the texture is\ncreated and — like `lazy` — are observed: changing one updates a texture that has already\nloaded, and removing one restores the engine default. Changing `srgb` or `mipmaps` on a loaded\ntexture recreates the underlying GPU resource, so prefer declaring those up front. Each option\noverrides the matching key in the `data` JSON; options left unset write nothing, leaving the\nengine's per-format defaults in force.\n\nApart from `lazy` and the texture options, these attributes are read once when the asset is\ncreated, so changing them later has no effect.\n\n---\n\n\n### **Events:**\n - **error** - Fired when the asset fails to load, with the engine's error in `message`. Does not bubble. The element still becomes ready — readiness means the load settled, not that it succeeded.\n- **load** - Fired each time the asset finishes loading, including a `lazy` asset loaded later and any subsequent reloads. Does not bubble — listen on this element, or use a capture-phase listener on an ancestor to observe every asset.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **get(id: _string_): __** - Returns the Asset created by the `<pc-asset>` element with the given `id`, or\n`undefined` if there is no such element or its asset has not been created yet.\n- **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
54
54
|
"attributes": [
|
|
55
|
+
{
|
|
56
|
+
"name": "address-u",
|
|
57
|
+
"description": "The texture's horizontal (U) address mode.",
|
|
58
|
+
"values": [
|
|
59
|
+
{ "name": "repeat" },
|
|
60
|
+
{ "name": "clamp" },
|
|
61
|
+
{ "name": "mirror" }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "address-v",
|
|
66
|
+
"description": "The texture's vertical (V) address mode.",
|
|
67
|
+
"values": [
|
|
68
|
+
{ "name": "repeat" },
|
|
69
|
+
{ "name": "clamp" },
|
|
70
|
+
{ "name": "mirror" }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "anisotropy",
|
|
75
|
+
"description": "The texture's maximum anisotropic filtering level.",
|
|
76
|
+
"values": []
|
|
77
|
+
},
|
|
55
78
|
{
|
|
56
79
|
"name": "atlas",
|
|
57
80
|
"description": "For a `sprite` asset, the `id` of the texture atlas asset it uses. The atlas must be declared before the sprite.",
|
|
@@ -62,6 +85,11 @@
|
|
|
62
85
|
"description": "Additional asset data, as a JSON object.",
|
|
63
86
|
"values": []
|
|
64
87
|
},
|
|
88
|
+
{
|
|
89
|
+
"name": "flip-y",
|
|
90
|
+
"description": "Whether the texture's image data is flipped vertically at upload.",
|
|
91
|
+
"values": []
|
|
92
|
+
},
|
|
65
93
|
{
|
|
66
94
|
"name": "frame-keys",
|
|
67
95
|
"description": "For a `sprite` asset, the atlas frame keys it uses, separated by spaces or commas.",
|
|
@@ -77,6 +105,28 @@
|
|
|
77
105
|
"description": "Whether the asset should be loaded lazily.",
|
|
78
106
|
"values": []
|
|
79
107
|
},
|
|
108
|
+
{
|
|
109
|
+
"name": "mag-filter",
|
|
110
|
+
"description": "The texture's magnification filter.",
|
|
111
|
+
"values": [{ "name": "nearest" }, { "name": "linear" }]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "min-filter",
|
|
115
|
+
"description": "The texture's minification filter.",
|
|
116
|
+
"values": [
|
|
117
|
+
{ "name": "nearest" },
|
|
118
|
+
{ "name": "linear" },
|
|
119
|
+
{ "name": "nearest-mip-nearest" },
|
|
120
|
+
{ "name": "linear-mip-nearest" },
|
|
121
|
+
{ "name": "nearest-mip-linear" },
|
|
122
|
+
{ "name": "linear-mip-linear" }
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "mipmaps",
|
|
127
|
+
"description": "Whether the texture generates and uses mipmaps.",
|
|
128
|
+
"values": []
|
|
129
|
+
},
|
|
80
130
|
{
|
|
81
131
|
"name": "pixels-per-unit",
|
|
82
132
|
"description": "For a `sprite` asset, the number of pixels per world unit.",
|
|
@@ -96,6 +146,11 @@
|
|
|
96
146
|
"description": "The URL of the asset to load.",
|
|
97
147
|
"values": []
|
|
98
148
|
},
|
|
149
|
+
{
|
|
150
|
+
"name": "srgb",
|
|
151
|
+
"description": "Whether the texture holds sRGB (gamma-encoded) color data.",
|
|
152
|
+
"values": []
|
|
153
|
+
},
|
|
99
154
|
{
|
|
100
155
|
"name": "type",
|
|
101
156
|
"description": "The asset type. Inferred from the `src` file extension when omitted.",
|
|
@@ -643,7 +698,7 @@
|
|
|
643
698
|
},
|
|
644
699
|
{
|
|
645
700
|
"name": "pc-model",
|
|
646
|
-
"description": "The ModelElement interface provides properties and methods for manipulating\n[`<pc-model>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-model/) elements.\nThe ModelElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
701
|
+
"description": "The ModelElement interface provides properties and methods for manipulating\n[`<pc-model>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-model/) elements.\nThe ModelElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nThe element becomes ready once its container asset has loaded and the instantiated hierarchy has\nbeen added to the scene — `entity` is non-null by then. A failed load also settles readiness,\nwith `entity` remaining `null`: readiness means the load settled, not that it succeeded — listen\nfor `error`, or check `entity`, to tell the outcomes apart. Changing `asset` re-arms readiness\nand instantiates anew, so a `ready()` obtained after the change resolves against the new\nhierarchy. A `pc-model` outside a `pc-app`, or referencing an unknown asset id, warns and never\nbecomes ready.\n\n---\n\n\n### **Events:**\n - **error** - Fired when the container asset fails to load, with the engine's error in `message`. Does not bubble. The element still becomes ready — readiness means the load settled, not that it succeeded.\n- **load** - Fired each time a container asset finishes instantiating, including re-instantiation after `asset` changes. Does not bubble — listen on this element, or use a capture-phase listener on an ancestor.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
647
702
|
"attributes": [
|
|
648
703
|
{
|
|
649
704
|
"name": "asset",
|
|
@@ -655,7 +710,7 @@
|
|
|
655
710
|
},
|
|
656
711
|
{
|
|
657
712
|
"name": "pc-module",
|
|
658
|
-
"description": "The ModuleElement interface provides properties and methods for manipulating\n[`<pc-module>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-module/)
|
|
713
|
+
"description": "The ModuleElement interface provides properties and methods for manipulating\n[`<pc-module>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-module/)\nelements. The ModuleElement interface also inherits the properties and methods of the\nAsyncElement interface.\n\nThe attributes are read once, when the module starts loading - on the element's first\nconnection, or earlier if a containing `<pc-app>` boots first and collects it - so changing\nthem later has no effect. The element becomes ready once the module has loaded. WebAssembly\nmodules configure engine-global state that never unloads, so readiness is not re-armed by\nremoving the element, and a re-inserted element does not load again.\n\nA `<pc-module>` without a `name` warns and never becomes ready; a containing `<pc-app>` still\nboots.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
659
714
|
"attributes": [
|
|
660
715
|
{
|
|
661
716
|
"name": "fallback",
|
|
@@ -680,6 +735,73 @@
|
|
|
680
735
|
],
|
|
681
736
|
"references": []
|
|
682
737
|
},
|
|
738
|
+
{
|
|
739
|
+
"name": "pc-node",
|
|
740
|
+
"description": "The NodeElement interface provides properties and methods for manipulating\n[`<pc-node>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-node/)\nelements. The NodeElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nA `pc-node` is an override element: where `pc-entity` creates an entity, `pc-node` binds to a\nnode a `pc-model` loaded and declares overrides against the authored asset — components to\nadd, properties to change, content to attach. Attributes present apply as overrides; attributes\nabsent leave authored values untouched, and removing an attribute (or assigning `null` to the\nmatching property) restores the authored value.\n\n`name` selects among the host model's nodes (first match in depth-first order), nesting a\n`pc-node` inside another scopes the search to that subtree, and `index` picks among identically\nnamed matches. When `name` matches more than one node and no `index` is given, the element\nwarns and binds nothing.\n\nThe element becomes ready once bound, and never while unresolved — a missing or ambiguous\nname warns and records the failure in `state`, readiness stays unresolved, and descendants\nwait with it.\n\nThe pointer events below are dispatched by the containing `<pc-app>` element when the pointer\nintersects the bound node's geometry, exactly as for `<pc-entity>`.\n\n---\n\n\n### **Events:**\n - **pointerdown** - Fired when a pointer button is pressed over the node.\n- **pointerenter** - Fired when the pointer moves onto the node.\n- **pointerleave** - Fired when the pointer moves off the node.\n- **pointermove** - Fired when the pointer moves over the node.\n- **pointerup** - Fired when a pointer button is released over the node.\n- **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
741
|
+
"attributes": [
|
|
742
|
+
{
|
|
743
|
+
"name": "enabled",
|
|
744
|
+
"description": "Overrides the node's enabled state.",
|
|
745
|
+
"values": []
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"name": "index",
|
|
749
|
+
"description": "Which match to bind when `name` matches more than one node, 0-based in depth-first order. Optional for a unique match; required for an ambiguous one.",
|
|
750
|
+
"values": []
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"name": "name",
|
|
754
|
+
"description": "The name of the node to bind, resolved within the nearest ancestor `pc-model` (or `pc-node`) once it has instantiated.",
|
|
755
|
+
"values": []
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "onpointerdown",
|
|
759
|
+
"description": "Script to run when a pointer button is pressed over the node.",
|
|
760
|
+
"values": []
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
"name": "onpointerenter",
|
|
764
|
+
"description": "Script to run when the pointer moves onto the node.",
|
|
765
|
+
"values": []
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"name": "onpointerleave",
|
|
769
|
+
"description": "Script to run when the pointer moves off the node.",
|
|
770
|
+
"values": []
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"name": "onpointermove",
|
|
774
|
+
"description": "Script to run when the pointer moves over the node.",
|
|
775
|
+
"values": []
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "onpointerup",
|
|
779
|
+
"description": "Script to run when a pointer button is released over the node.",
|
|
780
|
+
"values": []
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
"name": "position",
|
|
784
|
+
"description": "Overrides the node's local position, as an \"x y z\" triple.",
|
|
785
|
+
"values": []
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"name": "rotation",
|
|
789
|
+
"description": "Overrides the node's local rotation (Euler angles), as an \"x y z\" triple.",
|
|
790
|
+
"values": []
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
"name": "scale",
|
|
794
|
+
"description": "Overrides the node's local scale, as an \"x y z\" triple.",
|
|
795
|
+
"values": []
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"name": "tags",
|
|
799
|
+
"description": "Overrides the node's tags, separated by spaces or commas.",
|
|
800
|
+
"values": []
|
|
801
|
+
}
|
|
802
|
+
],
|
|
803
|
+
"references": []
|
|
804
|
+
},
|
|
683
805
|
{
|
|
684
806
|
"name": "pc-scene",
|
|
685
807
|
"description": "The SceneElement interface provides properties and methods for manipulating\n[`<pc-scene>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-scene/) elements.\nThe SceneElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
@@ -968,7 +1090,7 @@
|
|
|
968
1090
|
},
|
|
969
1091
|
{
|
|
970
1092
|
"name": "pc-collision",
|
|
971
|
-
"description": "The CollisionComponentElement interface provides properties and methods for manipulating\n[`<pc-collision>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-collision/) elements.\nThe CollisionComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
1093
|
+
"description": "The CollisionComponentElement interface provides properties and methods for manipulating\n[`<pc-collision>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-collision/) elements.\nThe CollisionComponentElement interface also inherits the properties and methods of the\nHTMLElement interface.\n\nFor `type=\"mesh\"`, the collision geometry defaults to the host entity's own render component\n(its render asset) — a collider matching the visible mesh, which is what a mesh collider on a\nglTF node means. The default resolves each time the component applies, so a `pc-node` that\nretargets or rebinds picks up the new node's geometry. An entity with no asset-backed render\ncomponent warns, and the collider has no shape.\n\n---\n\n\n### **Events:**\n - **ready** - Fired when the element is fully initialized — once per readiness cycle, so an element that is torn down and re-initialized (for example by removing and re-inserting it) fires it again. Bubbles and is composed.\n\n### **Methods:**\n - **ready(): __** - Returns a promise that resolves with this element when it's ready. This is the low-level\nprimitive underlying whenReady, which is the recommended way to wait for elements.\n\nReadiness tracks the element's current lifecycle: once a ready element is torn down (for\nexample by removing it from the document), this returns a fresh promise that resolves when\nthe element is next ready. A promise obtained earlier stays resolved — call this again\nafter re-inserting an element rather than reusing a promise from before its removal.",
|
|
972
1094
|
"attributes": [
|
|
973
1095
|
{
|
|
974
1096
|
"name": "angular-offset",
|