@revideo/2d 0.5.9 → 0.5.10-alpha.1094
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/editor/editor/tsconfig.build.tsbuildinfo +1 -1
- package/lib/components/Media.d.ts +1 -1
- package/lib/components/Media.d.ts.map +1 -1
- package/lib/components/Media.js +1 -1
- package/lib/scenes/Scene2D.d.ts +2 -0
- package/lib/scenes/Scene2D.d.ts.map +1 -1
- package/lib/scenes/Scene2D.js +13 -2
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/lib/components/Media.ts +1 -1
- package/src/lib/scenes/Scene2D.ts +17 -3
|
@@ -76,9 +76,12 @@ export class Scene2D extends GeneratorScene<View2D> implements Inspectable {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
public inspectPosition(x: number, y: number): InspectedElement | null {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
const node = this.getNodeByPosition(x, y);
|
|
80
|
+
return node?.key;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public getNodeByPosition(x: number, y: number): Node | null {
|
|
84
|
+
return this.execute(() => this.getView().hit(new Vector2(x, y)) ?? null);
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
public validateInspection(
|
|
@@ -210,6 +213,17 @@ export class Scene2D extends GeneratorScene<View2D> implements Inspectable {
|
|
|
210
213
|
}
|
|
211
214
|
}
|
|
212
215
|
|
|
216
|
+
public override adjustVolume(volumeScale: number) {
|
|
217
|
+
const mediaNodes = Array.from(this.registeredNodes.values()).filter(
|
|
218
|
+
(node): node is Media => node instanceof Media,
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
for (const media of mediaNodes) {
|
|
222
|
+
media.setVolume(media.getVolume() * volumeScale);
|
|
223
|
+
console.log(media.key);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
213
227
|
protected recreateView() {
|
|
214
228
|
this.execute(() => {
|
|
215
229
|
const size = this.getSize();
|