@playcanvas/inspector 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/package.json +1 -1
- package/src/asset-view.js +24 -17
- package/src/camera-view.js +5 -3
- package/src/context-menu.js +231 -0
- package/src/copy-json.js +692 -0
- package/src/describe.js +20 -1
- package/src/frame-graph-view.js +1 -0
- package/src/hierarchy-view.js +29 -3
- package/src/inspector.js +406 -59
- package/src/list-view.js +118 -12
- package/src/material-view.js +7 -6
- package/src/memory-view.js +224 -66
- package/src/mesh-view.js +6 -5
- package/src/model.js +24 -2
- package/src/node-model.js +78 -9
- package/src/property-view.js +159 -5
- package/src/render-target-view.js +3 -3
- package/src/script-view.js +21 -12
- package/src/styles.js +196 -2
- package/src/texture-view.js +4 -4
- package/src/transform-tool.js +185 -0
- package/types/asset-view.d.ts +3 -1
- package/types/camera-view.d.ts +4 -0
- package/types/context-menu.d.ts +90 -0
- package/types/copy-json.d.ts +69 -0
- package/types/describe.d.ts +1 -1
- package/types/hierarchy-view.d.ts +13 -0
- package/types/inspector.d.ts +141 -21
- package/types/list-view.d.ts +44 -3
- package/types/material-view.d.ts +3 -1
- package/types/memory-view.d.ts +24 -25
- package/types/mesh-view.d.ts +3 -1
- package/types/model.d.ts +16 -1
- package/types/node-model.d.ts +17 -1
- package/types/property-view.d.ts +41 -0
- package/types/script-view.d.ts +3 -1
- package/types/transform-tool.d.ts +92 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export type TransformMode = "translate" | "rotate" | "scale";
|
|
2
|
+
declare const POINTER_EVENTS: string[];
|
|
3
|
+
/**
|
|
4
|
+
* Moves, rotates or scales a node in the view with one of the engine's transform gizmos, drawn on
|
|
5
|
+
* a layer of its own over the view of a camera. The gizmo listens to the canvas itself, after the
|
|
6
|
+
* app's own listeners, so a drag of its handles would also reach the app and move its camera too.
|
|
7
|
+
* The tool takes those listeners away and hands the gizmo the pointer itself: a press on a handle
|
|
8
|
+
* and the drag that follows go to the gizmo alone, and everything else to the app as usual.
|
|
9
|
+
*
|
|
10
|
+
* The gizmo has no public way to be handed input, so it is handed its own pointer handlers. Engines
|
|
11
|
+
* whose gizmos lack them get no tool, see {@link TransformTool.supported}.
|
|
12
|
+
*
|
|
13
|
+
* @ignore
|
|
14
|
+
*/
|
|
15
|
+
export class TransformTool {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the engine's gizmos can be driven by the tool.
|
|
18
|
+
*
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
*/
|
|
21
|
+
static get supported(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @param {AppBase} app - The app.
|
|
24
|
+
* @param {TransformMode} mode - What the tool does to the node.
|
|
25
|
+
* @param {CameraComponent} camera - The camera whose view the gizmo is drawn and used in.
|
|
26
|
+
* @param {() => void} [onTransform] - Called whenever the gizmo changes the node.
|
|
27
|
+
*/
|
|
28
|
+
constructor(app: AppBase, mode: TransformMode, camera: CameraComponent, onTransform?: () => void);
|
|
29
|
+
/**
|
|
30
|
+
* What the tool does to the node.
|
|
31
|
+
*
|
|
32
|
+
* @type {TransformMode}
|
|
33
|
+
*/
|
|
34
|
+
mode: TransformMode;
|
|
35
|
+
/**
|
|
36
|
+
* @type {AppBase}
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
private _app;
|
|
40
|
+
/**
|
|
41
|
+
* @type {Layer}
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
private _layer;
|
|
45
|
+
/**
|
|
46
|
+
* @type {any}
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
private _gizmo;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a handle is being dragged, which keeps the pointer from the app until it is let go.
|
|
52
|
+
*
|
|
53
|
+
* @type {boolean}
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
private _dragging;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the click that follows the end of a drag is still to come, to keep it from the app.
|
|
59
|
+
*
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
private _endingDrag;
|
|
64
|
+
/**
|
|
65
|
+
* The entity of the gizmo, which the app's hierarchy holds while the tool is on.
|
|
66
|
+
*
|
|
67
|
+
* @type {Entity}
|
|
68
|
+
*/
|
|
69
|
+
get root(): Entity;
|
|
70
|
+
/**
|
|
71
|
+
* Puts the gizmo on a node, or takes it off.
|
|
72
|
+
*
|
|
73
|
+
* @param {GraphNode|null} node - The node, or null for none.
|
|
74
|
+
*/
|
|
75
|
+
attach(node: GraphNode | null): void;
|
|
76
|
+
/**
|
|
77
|
+
* Hands the gizmo a pointer event on the canvas, ahead of everything else listening to it.
|
|
78
|
+
*
|
|
79
|
+
* @param {Event} e - The event.
|
|
80
|
+
* @returns {boolean} Whether the gizmo keeps the event, which nothing else is then to see.
|
|
81
|
+
*/
|
|
82
|
+
handle(e: Event): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Takes the gizmo, its layer and its entity out of the app.
|
|
85
|
+
*/
|
|
86
|
+
destroy(): void;
|
|
87
|
+
}
|
|
88
|
+
import type { Entity } from 'playcanvas';
|
|
89
|
+
import type { GraphNode } from 'playcanvas';
|
|
90
|
+
import type { AppBase } from 'playcanvas';
|
|
91
|
+
import type { CameraComponent } from 'playcanvas';
|
|
92
|
+
export { POINTER_EVENTS as TRANSFORM_POINTER_EVENTS };
|