@playcanvas/web-components 0.12.0 → 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 +26 -3
- package/dist/asset.d.cts +218 -0
- package/dist/asset.d.ts +1 -1
- package/dist/async-element.d.cts +103 -0
- package/dist/async-element.d.ts +6 -4
- 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 +1 -1
- package/dist/components/component.d.cts +82 -0
- package/dist/components/component.d.ts +1 -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 +79 -21
- package/dist/entity-base.d.cts +67 -0
- package/dist/entity-base.d.ts +2 -2
- package/dist/entity.d.cts +131 -0
- package/dist/entity.d.ts +1 -1
- package/dist/index.d.cts +79 -0
- package/dist/index.d.ts +33 -33
- package/dist/loading-bar.d.cts +35 -0
- package/dist/material.d.cts +1011 -0
- package/dist/model.d.cts +72 -0
- package/dist/model.d.ts +1 -1
- 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 +1 -1
- package/dist/parse.d.cts +147 -0
- package/dist/pwc.cjs +141 -41
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +142 -42
- 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 +142 -42
- 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 +2 -2
- package/dist/web-types.json +41 -5
- package/package.json +16 -7
- package/src/app.ts +119 -30
- package/src/async-element.ts +4 -2
- package/src/loading-bar.ts +2 -2
- package/src/module.ts +39 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CSS_COLORS: Record<string, string>;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { ButtonComponent } from 'playcanvas';
|
|
2
|
+
import { Color, Vec4 } from 'playcanvas';
|
|
3
|
+
import { ComponentElement } from './component.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* The ButtonComponentElement interface provides properties and methods for manipulating
|
|
6
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-button/ | `<pc-button>`} elements.
|
|
7
|
+
* The ButtonComponentElement interface also inherits the properties and methods of the
|
|
8
|
+
* {@link HTMLElement} interface.
|
|
9
|
+
*
|
|
10
|
+
* @category Components
|
|
11
|
+
*/
|
|
12
|
+
declare class ButtonComponentElement extends ComponentElement {
|
|
13
|
+
private _active;
|
|
14
|
+
private _image;
|
|
15
|
+
private _hitPadding;
|
|
16
|
+
private _transitionMode;
|
|
17
|
+
private _hoverTint;
|
|
18
|
+
private _pressedTint;
|
|
19
|
+
private _inactiveTint;
|
|
20
|
+
private _fadeDuration;
|
|
21
|
+
private _hoverSpriteAsset;
|
|
22
|
+
private _hoverSpriteFrame;
|
|
23
|
+
private _pressedSpriteAsset;
|
|
24
|
+
private _pressedSpriteFrame;
|
|
25
|
+
private _inactiveSpriteAsset;
|
|
26
|
+
private _inactiveSpriteFrame;
|
|
27
|
+
/** @ignore */
|
|
28
|
+
constructor();
|
|
29
|
+
protected getInitialComponentData(): Record<string, any>;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the underlying PlayCanvas button component.
|
|
32
|
+
* @returns The button component.
|
|
33
|
+
*/
|
|
34
|
+
get component(): ButtonComponent;
|
|
35
|
+
/**
|
|
36
|
+
* Sets whether the button is active and responds to input.
|
|
37
|
+
* @param value - Whether the button is active.
|
|
38
|
+
*/
|
|
39
|
+
set active(value: boolean);
|
|
40
|
+
/**
|
|
41
|
+
* Gets whether the button is active.
|
|
42
|
+
* @returns Whether the button is active.
|
|
43
|
+
*/
|
|
44
|
+
get active(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the reference (CSS selector, element id or entity name) to the `<pc-entity>` whose image
|
|
47
|
+
* element is used for visual transitions. Defaults to the button's own entity.
|
|
48
|
+
* @param value - The image entity reference.
|
|
49
|
+
*/
|
|
50
|
+
set image(value: string);
|
|
51
|
+
/**
|
|
52
|
+
* Gets the reference to the `<pc-entity>` whose image element is used for visual transitions.
|
|
53
|
+
* @returns The image entity reference.
|
|
54
|
+
*/
|
|
55
|
+
get image(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Sets the padding used to expand the button's hit area, as a Vec4 (left, bottom, right, top).
|
|
58
|
+
* @param value - The hit padding.
|
|
59
|
+
*/
|
|
60
|
+
set hitPadding(value: Vec4);
|
|
61
|
+
/**
|
|
62
|
+
* Gets the padding used to expand the button's hit area.
|
|
63
|
+
* @returns The hit padding.
|
|
64
|
+
*/
|
|
65
|
+
get hitPadding(): Vec4;
|
|
66
|
+
/**
|
|
67
|
+
* Sets how the button reacts to being hovered/pressed. Can be `tint` or `sprite`. Defaults to
|
|
68
|
+
* `tint`.
|
|
69
|
+
* @param value - The transition mode.
|
|
70
|
+
*/
|
|
71
|
+
set transitionMode(value: 'tint' | 'sprite');
|
|
72
|
+
/**
|
|
73
|
+
* Gets how the button reacts to being hovered/pressed.
|
|
74
|
+
* @returns The transition mode.
|
|
75
|
+
*/
|
|
76
|
+
get transitionMode(): "tint" | "sprite";
|
|
77
|
+
/**
|
|
78
|
+
* Sets the tint color applied to the image entity when the button is hovered (tint transition
|
|
79
|
+
* mode).
|
|
80
|
+
* @param value - The hover tint.
|
|
81
|
+
*/
|
|
82
|
+
set hoverTint(value: Color);
|
|
83
|
+
/**
|
|
84
|
+
* Gets the hover tint color.
|
|
85
|
+
* @returns The hover tint.
|
|
86
|
+
*/
|
|
87
|
+
get hoverTint(): Color;
|
|
88
|
+
/**
|
|
89
|
+
* Sets the tint color applied to the image entity when the button is pressed (tint transition
|
|
90
|
+
* mode).
|
|
91
|
+
* @param value - The pressed tint.
|
|
92
|
+
*/
|
|
93
|
+
set pressedTint(value: Color);
|
|
94
|
+
/**
|
|
95
|
+
* Gets the pressed tint color.
|
|
96
|
+
* @returns The pressed tint.
|
|
97
|
+
*/
|
|
98
|
+
get pressedTint(): Color;
|
|
99
|
+
/**
|
|
100
|
+
* Sets the tint color applied to the image entity when the button is inactive (tint transition
|
|
101
|
+
* mode).
|
|
102
|
+
* @param value - The inactive tint.
|
|
103
|
+
*/
|
|
104
|
+
set inactiveTint(value: Color);
|
|
105
|
+
/**
|
|
106
|
+
* Gets the inactive tint color.
|
|
107
|
+
* @returns The inactive tint.
|
|
108
|
+
*/
|
|
109
|
+
get inactiveTint(): Color;
|
|
110
|
+
/**
|
|
111
|
+
* Sets the duration (in milliseconds) over which tint transitions are applied.
|
|
112
|
+
* @param value - The fade duration.
|
|
113
|
+
*/
|
|
114
|
+
set fadeDuration(value: number);
|
|
115
|
+
/**
|
|
116
|
+
* Gets the duration over which tint transitions are applied.
|
|
117
|
+
* @returns The fade duration.
|
|
118
|
+
*/
|
|
119
|
+
get fadeDuration(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Sets the id of the `pc-asset` sprite shown when the button is hovered (sprite transition
|
|
122
|
+
* mode).
|
|
123
|
+
* @param value - The hover sprite asset id.
|
|
124
|
+
*/
|
|
125
|
+
set hoverSpriteAsset(value: string);
|
|
126
|
+
/**
|
|
127
|
+
* Gets the id of the `pc-asset` sprite shown when the button is hovered.
|
|
128
|
+
* @returns The hover sprite asset id.
|
|
129
|
+
*/
|
|
130
|
+
get hoverSpriteAsset(): string;
|
|
131
|
+
/**
|
|
132
|
+
* Sets the frame of the hover sprite to show.
|
|
133
|
+
* @param value - The hover sprite frame.
|
|
134
|
+
*/
|
|
135
|
+
set hoverSpriteFrame(value: number);
|
|
136
|
+
/**
|
|
137
|
+
* Gets the frame of the hover sprite to show.
|
|
138
|
+
* @returns The hover sprite frame.
|
|
139
|
+
*/
|
|
140
|
+
get hoverSpriteFrame(): number;
|
|
141
|
+
/**
|
|
142
|
+
* Sets the id of the `pc-asset` sprite shown when the button is pressed (sprite transition
|
|
143
|
+
* mode).
|
|
144
|
+
* @param value - The pressed sprite asset id.
|
|
145
|
+
*/
|
|
146
|
+
set pressedSpriteAsset(value: string);
|
|
147
|
+
/**
|
|
148
|
+
* Gets the id of the `pc-asset` sprite shown when the button is pressed.
|
|
149
|
+
* @returns The pressed sprite asset id.
|
|
150
|
+
*/
|
|
151
|
+
get pressedSpriteAsset(): string;
|
|
152
|
+
/**
|
|
153
|
+
* Sets the frame of the pressed sprite to show.
|
|
154
|
+
* @param value - The pressed sprite frame.
|
|
155
|
+
*/
|
|
156
|
+
set pressedSpriteFrame(value: number);
|
|
157
|
+
/**
|
|
158
|
+
* Gets the frame of the pressed sprite to show.
|
|
159
|
+
* @returns The pressed sprite frame.
|
|
160
|
+
*/
|
|
161
|
+
get pressedSpriteFrame(): number;
|
|
162
|
+
/**
|
|
163
|
+
* Sets the id of the `pc-asset` sprite shown when the button is inactive (sprite transition
|
|
164
|
+
* mode).
|
|
165
|
+
* @param value - The inactive sprite asset id.
|
|
166
|
+
*/
|
|
167
|
+
set inactiveSpriteAsset(value: string);
|
|
168
|
+
/**
|
|
169
|
+
* Gets the id of the `pc-asset` sprite shown when the button is inactive.
|
|
170
|
+
* @returns The inactive sprite asset id.
|
|
171
|
+
*/
|
|
172
|
+
get inactiveSpriteAsset(): string;
|
|
173
|
+
/**
|
|
174
|
+
* Sets the frame of the inactive sprite to show.
|
|
175
|
+
* @param value - The inactive sprite frame.
|
|
176
|
+
*/
|
|
177
|
+
set inactiveSpriteFrame(value: number);
|
|
178
|
+
/**
|
|
179
|
+
* Gets the frame of the inactive sprite to show.
|
|
180
|
+
* @returns The inactive sprite frame.
|
|
181
|
+
*/
|
|
182
|
+
get inactiveSpriteFrame(): number;
|
|
183
|
+
static get observedAttributes(): string[];
|
|
184
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
185
|
+
}
|
|
186
|
+
export { ButtonComponentElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonComponent } from 'playcanvas';
|
|
2
2
|
import { Color, Vec4 } from 'playcanvas';
|
|
3
|
-
import { ComponentElement } from './component';
|
|
3
|
+
import { ComponentElement } from './component.js';
|
|
4
4
|
/**
|
|
5
5
|
* The ButtonComponentElement interface provides properties and methods for manipulating
|
|
6
6
|
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-button/ | `<pc-button>`} elements.
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { CameraComponent } from 'playcanvas';
|
|
2
|
+
import { Color, Vec4 } from 'playcanvas';
|
|
3
|
+
import { ComponentElement } from './component.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* The CameraComponentElement interface provides properties and methods for manipulating
|
|
6
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-camera/ | `<pc-camera>`} elements.
|
|
7
|
+
* The CameraComponentElement interface also inherits the properties and methods of the
|
|
8
|
+
* {@link HTMLElement} interface.
|
|
9
|
+
*
|
|
10
|
+
* @category Components
|
|
11
|
+
*/
|
|
12
|
+
declare class CameraComponentElement extends ComponentElement {
|
|
13
|
+
private _clearColor;
|
|
14
|
+
private _clearColorBuffer;
|
|
15
|
+
private _clearDepthBuffer;
|
|
16
|
+
private _clearStencilBuffer;
|
|
17
|
+
private _cullFaces;
|
|
18
|
+
private _farClip;
|
|
19
|
+
private _flipFaces;
|
|
20
|
+
private _fov;
|
|
21
|
+
private _frustumCulling;
|
|
22
|
+
private _gamma;
|
|
23
|
+
private _horizontalFov;
|
|
24
|
+
private _nearClip;
|
|
25
|
+
private _projection;
|
|
26
|
+
private _orthoHeight;
|
|
27
|
+
private _priority;
|
|
28
|
+
private _rect;
|
|
29
|
+
private _scissorRect;
|
|
30
|
+
private _tonemap;
|
|
31
|
+
/** @ignore */
|
|
32
|
+
constructor();
|
|
33
|
+
protected getInitialComponentData(): {
|
|
34
|
+
clearColor: Color;
|
|
35
|
+
clearColorBuffer: boolean;
|
|
36
|
+
clearDepthBuffer: boolean;
|
|
37
|
+
clearStencilBuffer: boolean;
|
|
38
|
+
cullFaces: boolean;
|
|
39
|
+
farClip: number;
|
|
40
|
+
flipFaces: boolean;
|
|
41
|
+
fov: number;
|
|
42
|
+
frustumCulling: boolean;
|
|
43
|
+
gammaCorrection: 0 | 1;
|
|
44
|
+
horizontalFov: boolean;
|
|
45
|
+
nearClip: number;
|
|
46
|
+
projection: number;
|
|
47
|
+
orthoHeight: number;
|
|
48
|
+
priority: number;
|
|
49
|
+
rect: Vec4;
|
|
50
|
+
scissorRect: Vec4;
|
|
51
|
+
toneMapping: number;
|
|
52
|
+
};
|
|
53
|
+
get xrAvailable(): boolean | null;
|
|
54
|
+
/**
|
|
55
|
+
* Starts the camera in XR mode.
|
|
56
|
+
* @param type - The type of XR mode to start.
|
|
57
|
+
* @param space - The space to start the camera in.
|
|
58
|
+
*/
|
|
59
|
+
startXr(type: 'immersive-ar' | 'immersive-vr', space: 'bounded-floor' | 'local' | 'local-floor' | 'unbounded' | 'viewer'): void;
|
|
60
|
+
/**
|
|
61
|
+
* Ends the camera's XR mode.
|
|
62
|
+
*/
|
|
63
|
+
endXr(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the underlying PlayCanvas camera component.
|
|
66
|
+
* @returns The camera component.
|
|
67
|
+
*/
|
|
68
|
+
get component(): CameraComponent;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the clear color of the camera.
|
|
71
|
+
* @param value - The clear color.
|
|
72
|
+
*/
|
|
73
|
+
set clearColor(value: Color);
|
|
74
|
+
/**
|
|
75
|
+
* Gets the clear color of the camera.
|
|
76
|
+
* @returns The clear color.
|
|
77
|
+
*/
|
|
78
|
+
get clearColor(): Color;
|
|
79
|
+
/**
|
|
80
|
+
* Sets the clear color buffer of the camera.
|
|
81
|
+
* @param value - The clear color buffer.
|
|
82
|
+
*/
|
|
83
|
+
set clearColorBuffer(value: boolean);
|
|
84
|
+
/**
|
|
85
|
+
* Gets the clear color buffer of the camera.
|
|
86
|
+
* @returns The clear color buffer.
|
|
87
|
+
*/
|
|
88
|
+
get clearColorBuffer(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Sets the clear depth buffer of the camera.
|
|
91
|
+
* @param value - The clear depth buffer.
|
|
92
|
+
*/
|
|
93
|
+
set clearDepthBuffer(value: boolean);
|
|
94
|
+
/**
|
|
95
|
+
* Gets the clear depth buffer of the camera.
|
|
96
|
+
* @returns The clear depth buffer.
|
|
97
|
+
*/
|
|
98
|
+
get clearDepthBuffer(): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Sets the clear stencil buffer of the camera.
|
|
101
|
+
* @param value - The clear stencil buffer.
|
|
102
|
+
*/
|
|
103
|
+
set clearStencilBuffer(value: boolean);
|
|
104
|
+
/**
|
|
105
|
+
* Gets the clear stencil buffer of the camera.
|
|
106
|
+
* @returns The clear stencil buffer.
|
|
107
|
+
*/
|
|
108
|
+
get clearStencilBuffer(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Sets the cull faces of the camera.
|
|
111
|
+
* @param value - The cull faces.
|
|
112
|
+
*/
|
|
113
|
+
set cullFaces(value: boolean);
|
|
114
|
+
/**
|
|
115
|
+
* Gets the cull faces of the camera.
|
|
116
|
+
* @returns The cull faces.
|
|
117
|
+
*/
|
|
118
|
+
get cullFaces(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Sets the far clip distance of the camera.
|
|
121
|
+
* @param value - The far clip distance.
|
|
122
|
+
*/
|
|
123
|
+
set farClip(value: number);
|
|
124
|
+
/**
|
|
125
|
+
* Gets the far clip distance of the camera.
|
|
126
|
+
* @returns The far clip distance.
|
|
127
|
+
*/
|
|
128
|
+
get farClip(): number;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the flip faces of the camera.
|
|
131
|
+
* @param value - The flip faces.
|
|
132
|
+
*/
|
|
133
|
+
set flipFaces(value: boolean);
|
|
134
|
+
/**
|
|
135
|
+
* Gets the flip faces of the camera.
|
|
136
|
+
* @returns The flip faces.
|
|
137
|
+
*/
|
|
138
|
+
get flipFaces(): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Sets the field of view of the camera.
|
|
141
|
+
* @param value - The field of view.
|
|
142
|
+
*/
|
|
143
|
+
set fov(value: number);
|
|
144
|
+
/**
|
|
145
|
+
* Gets the field of view of the camera.
|
|
146
|
+
* @returns The field of view.
|
|
147
|
+
*/
|
|
148
|
+
get fov(): number;
|
|
149
|
+
/**
|
|
150
|
+
* Sets the frustum culling of the camera.
|
|
151
|
+
* @param value - The frustum culling.
|
|
152
|
+
*/
|
|
153
|
+
set frustumCulling(value: boolean);
|
|
154
|
+
/**
|
|
155
|
+
* Gets the frustum culling of the camera.
|
|
156
|
+
* @returns The frustum culling.
|
|
157
|
+
*/
|
|
158
|
+
get frustumCulling(): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Sets the gamma correction of the camera.
|
|
161
|
+
* @param value - The gamma correction.
|
|
162
|
+
*/
|
|
163
|
+
set gamma(value: 'linear' | 'srgb');
|
|
164
|
+
/**
|
|
165
|
+
* Gets the gamma correction of the camera.
|
|
166
|
+
* @returns The gamma correction.
|
|
167
|
+
*/
|
|
168
|
+
get gamma(): 'linear' | 'srgb';
|
|
169
|
+
/**
|
|
170
|
+
* Sets whether the camera's field of view (fov) is horizontal or vertical. Defaults to false
|
|
171
|
+
* (meaning it is vertical be default).
|
|
172
|
+
* @param value - Whether the camera's field of view is horizontal.
|
|
173
|
+
*/
|
|
174
|
+
set horizontalFov(value: boolean);
|
|
175
|
+
/**
|
|
176
|
+
* Gets whether the camera's field of view (fov) is horizontal or vertical.
|
|
177
|
+
* @returns Whether the camera's field of view is horizontal.
|
|
178
|
+
*/
|
|
179
|
+
get horizontalFov(): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Sets the near clip distance of the camera.
|
|
182
|
+
* @param value - The near clip distance.
|
|
183
|
+
*/
|
|
184
|
+
set nearClip(value: number);
|
|
185
|
+
/**
|
|
186
|
+
* Gets the near clip distance of the camera.
|
|
187
|
+
* @returns The near clip distance.
|
|
188
|
+
*/
|
|
189
|
+
get nearClip(): number;
|
|
190
|
+
/**
|
|
191
|
+
* Sets the orthographic height of the camera.
|
|
192
|
+
* @param value - The orthographic height.
|
|
193
|
+
*/
|
|
194
|
+
set orthoHeight(value: number);
|
|
195
|
+
/**
|
|
196
|
+
* Gets the orthographic height of the camera.
|
|
197
|
+
* @returns The orthographic height.
|
|
198
|
+
*/
|
|
199
|
+
get orthoHeight(): number;
|
|
200
|
+
/**
|
|
201
|
+
* Sets the priority of the camera.
|
|
202
|
+
* @param value - The priority.
|
|
203
|
+
*/
|
|
204
|
+
set priority(value: number);
|
|
205
|
+
/**
|
|
206
|
+
* Gets the priority of the camera.
|
|
207
|
+
* @returns The priority.
|
|
208
|
+
*/
|
|
209
|
+
get priority(): number;
|
|
210
|
+
/**
|
|
211
|
+
* Sets the projection of the camera. Use `orthoHeight` to size an orthographic projection.
|
|
212
|
+
* @param value - The projection ('perspective' or 'orthographic').
|
|
213
|
+
*/
|
|
214
|
+
set projection(value: 'perspective' | 'orthographic');
|
|
215
|
+
/**
|
|
216
|
+
* Gets the projection of the camera.
|
|
217
|
+
* @returns The projection.
|
|
218
|
+
*/
|
|
219
|
+
get projection(): "perspective" | "orthographic";
|
|
220
|
+
/**
|
|
221
|
+
* Sets the rect of the camera.
|
|
222
|
+
* @param value - The rect.
|
|
223
|
+
*/
|
|
224
|
+
set rect(value: Vec4);
|
|
225
|
+
/**
|
|
226
|
+
* Gets the rect of the camera.
|
|
227
|
+
* @returns The rect.
|
|
228
|
+
*/
|
|
229
|
+
get rect(): Vec4;
|
|
230
|
+
/**
|
|
231
|
+
* Sets the scissor rect of the camera.
|
|
232
|
+
* @param value - The scissor rect.
|
|
233
|
+
*/
|
|
234
|
+
set scissorRect(value: Vec4);
|
|
235
|
+
/**
|
|
236
|
+
* Gets the scissor rect of the camera.
|
|
237
|
+
* @returns The scissor rect.
|
|
238
|
+
*/
|
|
239
|
+
get scissorRect(): Vec4;
|
|
240
|
+
/**
|
|
241
|
+
* Sets the tone mapping of the camera.
|
|
242
|
+
* @param value - The tone mapping.
|
|
243
|
+
*/
|
|
244
|
+
set tonemap(value: 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral');
|
|
245
|
+
/**
|
|
246
|
+
* Gets the tone mapping of the camera.
|
|
247
|
+
* @returns The tone mapping.
|
|
248
|
+
*/
|
|
249
|
+
get tonemap(): 'none' | 'linear' | 'filmic' | 'hejl' | 'aces' | 'aces2' | 'neutral';
|
|
250
|
+
static get observedAttributes(): string[];
|
|
251
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
252
|
+
}
|
|
253
|
+
export { CameraComponentElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CameraComponent } from 'playcanvas';
|
|
2
2
|
import { Color, Vec4 } from 'playcanvas';
|
|
3
|
-
import { ComponentElement } from './component';
|
|
3
|
+
import { ComponentElement } from './component.js';
|
|
4
4
|
/**
|
|
5
5
|
* The CameraComponentElement interface provides properties and methods for manipulating
|
|
6
6
|
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-camera/ | `<pc-camera>`} elements.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { CollisionComponent } from 'playcanvas';
|
|
2
|
+
import { Quat, Vec3 } from 'playcanvas';
|
|
3
|
+
import { ComponentElement } from './component.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* The CollisionComponentElement interface provides properties and methods for manipulating
|
|
6
|
+
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-collision/ | `<pc-collision>`} elements.
|
|
7
|
+
* The CollisionComponentElement interface also inherits the properties and methods of the
|
|
8
|
+
* {@link HTMLElement} interface.
|
|
9
|
+
*
|
|
10
|
+
* For `type="mesh"`, the collision geometry defaults to the host entity's own render component
|
|
11
|
+
* (its render asset) — a collider matching the visible mesh, which is what a mesh collider on a
|
|
12
|
+
* glTF node means. The default resolves each time the component applies, so a `pc-node` that
|
|
13
|
+
* retargets or rebinds picks up the new node's geometry. An entity with no asset-backed render
|
|
14
|
+
* component warns, and the collider has no shape.
|
|
15
|
+
*
|
|
16
|
+
* @category Components
|
|
17
|
+
*/
|
|
18
|
+
declare class CollisionComponentElement extends ComponentElement {
|
|
19
|
+
private _angularOffset;
|
|
20
|
+
private _axis;
|
|
21
|
+
private _convexHull;
|
|
22
|
+
private _halfExtents;
|
|
23
|
+
private _height;
|
|
24
|
+
private _linearOffset;
|
|
25
|
+
private _radius;
|
|
26
|
+
private _type;
|
|
27
|
+
/** @ignore */
|
|
28
|
+
constructor();
|
|
29
|
+
protected getInitialComponentData(): {
|
|
30
|
+
axis: number;
|
|
31
|
+
angularOffset: Quat;
|
|
32
|
+
convexHull: boolean;
|
|
33
|
+
halfExtents: Vec3;
|
|
34
|
+
height: number;
|
|
35
|
+
linearOffset: Vec3;
|
|
36
|
+
radius: number;
|
|
37
|
+
type: "box" | "capsule" | "compound" | "cone" | "cylinder" | "mesh" | "sphere";
|
|
38
|
+
};
|
|
39
|
+
protected initComponent(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Defaults a mesh collider's geometry to the host entity's own render component. The
|
|
42
|
+
* engine's mesh collider only works with explicitly supplied geometry, and the element has
|
|
43
|
+
* no attribute to supply it - so the host's visible geometry, the meaning a mesh collider
|
|
44
|
+
* on a glTF node carries, fills the gap. Runs on every application (so a rebound `pc-node`
|
|
45
|
+
* recomputes it) and on a runtime switch to `type="mesh"`; an explicitly assigned
|
|
46
|
+
* `renderAsset` is never overwritten.
|
|
47
|
+
*/
|
|
48
|
+
private _applyMeshGeometryDefault;
|
|
49
|
+
/**
|
|
50
|
+
* Gets the underlying PlayCanvas collision component.
|
|
51
|
+
* @returns The collision component.
|
|
52
|
+
*/
|
|
53
|
+
get component(): CollisionComponent;
|
|
54
|
+
set angularOffset(value: Quat);
|
|
55
|
+
get angularOffset(): Quat;
|
|
56
|
+
set axis(value: number);
|
|
57
|
+
get axis(): number;
|
|
58
|
+
set convexHull(value: boolean);
|
|
59
|
+
get convexHull(): boolean;
|
|
60
|
+
set halfExtents(value: Vec3);
|
|
61
|
+
get halfExtents(): Vec3;
|
|
62
|
+
set height(value: number);
|
|
63
|
+
get height(): number;
|
|
64
|
+
set linearOffset(value: Vec3);
|
|
65
|
+
get linearOffset(): Vec3;
|
|
66
|
+
set radius(value: number);
|
|
67
|
+
get radius(): number;
|
|
68
|
+
set type(value: 'box' | 'capsule' | 'compound' | 'cone' | 'cylinder' | 'mesh' | 'sphere');
|
|
69
|
+
get type(): "box" | "capsule" | "compound" | "cone" | "cylinder" | "mesh" | "sphere";
|
|
70
|
+
static get observedAttributes(): string[];
|
|
71
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
72
|
+
}
|
|
73
|
+
export { CollisionComponentElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CollisionComponent } from 'playcanvas';
|
|
2
2
|
import { Quat, Vec3 } from 'playcanvas';
|
|
3
|
-
import { ComponentElement } from './component';
|
|
3
|
+
import { ComponentElement } from './component.js';
|
|
4
4
|
/**
|
|
5
5
|
* The CollisionComponentElement interface provides properties and methods for manipulating
|
|
6
6
|
* {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-collision/ | `<pc-collision>`} elements.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Component } from 'playcanvas';
|
|
2
|
+
import { AsyncElement } from '../async-element.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a component in the PlayCanvas engine.
|
|
5
|
+
*
|
|
6
|
+
* @category Components
|
|
7
|
+
*/
|
|
8
|
+
declare class ComponentElement extends AsyncElement {
|
|
9
|
+
private _componentName;
|
|
10
|
+
private _enabled;
|
|
11
|
+
private _component;
|
|
12
|
+
private _appElement;
|
|
13
|
+
/**
|
|
14
|
+
* The element hosting this component, held so the host's readiness cycles can be observed
|
|
15
|
+
* even after `closestEntity` would no longer resolve (during teardown).
|
|
16
|
+
*/
|
|
17
|
+
private _hostElement;
|
|
18
|
+
/**
|
|
19
|
+
* The listener re-applying this component when the host's readiness cycles. Held for
|
|
20
|
+
* removal on disconnect.
|
|
21
|
+
*/
|
|
22
|
+
private _hostReadyListener;
|
|
23
|
+
/**
|
|
24
|
+
* Incremented on every connect and disconnect. connectedCallback captures the value on entry
|
|
25
|
+
* and abandons itself wherever it resumes from an await if the value has moved on — so a
|
|
26
|
+
* callback whose element was removed cannot act on a torn-down tree, and one whose element
|
|
27
|
+
* was removed and re-inserted (which runs a callback of its own) cannot add the component a
|
|
28
|
+
* second time.
|
|
29
|
+
*/
|
|
30
|
+
private _connectionGeneration;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new ComponentElement instance.
|
|
33
|
+
*
|
|
34
|
+
* @param componentName - The name of the component.
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
constructor(componentName: string);
|
|
38
|
+
/**
|
|
39
|
+
* Returns the data the component is created with. Overridden by subclasses to supply the
|
|
40
|
+
* initial values of their cached properties.
|
|
41
|
+
*
|
|
42
|
+
* @returns The initial component data.
|
|
43
|
+
*/
|
|
44
|
+
protected getInitialComponentData(): {};
|
|
45
|
+
/**
|
|
46
|
+
* Creates the component on the host's current entity, removing it first from a previous
|
|
47
|
+
* entity that is still alive (a retargeted `<pc-node>` moves its decorations with it). When
|
|
48
|
+
* the entity already has a component of this type — a glTF node arriving with its authored
|
|
49
|
+
* `render` component, say — warns and leaves `component` null. The element-level warning is
|
|
50
|
+
* load-bearing: the engine's own duplicate-addComponent warning is Debug-stripped from
|
|
51
|
+
* production builds, which would otherwise leave a silent null.
|
|
52
|
+
*/
|
|
53
|
+
private _applyComponent;
|
|
54
|
+
private _addComponent;
|
|
55
|
+
/**
|
|
56
|
+
* Configures the newly added component. Overridden by subclasses whose setup goes beyond
|
|
57
|
+
* the initial data — child-element handling, asset resolution and the like.
|
|
58
|
+
*/
|
|
59
|
+
protected initComponent(): void;
|
|
60
|
+
connectedCallback(): Promise<void>;
|
|
61
|
+
disconnectedCallback(): void;
|
|
62
|
+
/**
|
|
63
|
+
* The PlayCanvas component instance. `null` until the element is ready, and also for an
|
|
64
|
+
* element that is not a descendant of a `<pc-entity>` — await {@link whenReady} or the
|
|
65
|
+
* element's `ready()` promise before accessing it.
|
|
66
|
+
* @returns The component instance, or `null`.
|
|
67
|
+
*/
|
|
68
|
+
get component(): Component | null;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the enabled state of the component.
|
|
71
|
+
* @param value - The enabled state of the component.
|
|
72
|
+
*/
|
|
73
|
+
set enabled(value: boolean);
|
|
74
|
+
/**
|
|
75
|
+
* Gets the enabled state of the component.
|
|
76
|
+
* @returns The enabled state of the component.
|
|
77
|
+
*/
|
|
78
|
+
get enabled(): boolean;
|
|
79
|
+
static get observedAttributes(): string[];
|
|
80
|
+
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
81
|
+
}
|
|
82
|
+
export { ComponentElement };
|