@spatialwalk/avatarkit 1.0.0-beta.34 → 1.0.0-beta.35
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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.0-beta.35] - 2025-12-16
|
|
9
|
+
|
|
10
|
+
### 🔄 API Changes
|
|
11
|
+
- **Avatar Transform API** - Changed `setTransform` method to `transform` getter/setter property for more idiomatic JavaScript API. Now supports both reading and setting transform values.
|
|
12
|
+
|
|
8
13
|
## [1.0.0-beta.34] - 2025-12-16
|
|
9
14
|
|
|
10
15
|
### ✨ New Features
|
package/README.md
CHANGED
|
@@ -292,8 +292,12 @@ const avatarView = new AvatarView(avatar, container)
|
|
|
292
292
|
// Wait for first frame to render
|
|
293
293
|
await avatarView.ready // Promise that resolves when the first frame is rendered
|
|
294
294
|
|
|
295
|
-
//
|
|
296
|
-
|
|
295
|
+
// Get or set avatar transform (position and scale)
|
|
296
|
+
// Get current transform
|
|
297
|
+
const currentTransform = avatarView.transform // { x: number, y: number, scale: number }
|
|
298
|
+
|
|
299
|
+
// Set transform
|
|
300
|
+
avatarView.transform = { x, y, scale }
|
|
297
301
|
// - x: Horizontal offset in normalized coordinates (-1 to 1, where -1 = left edge, 0 = center, 1 = right edge)
|
|
298
302
|
// - y: Vertical offset in normalized coordinates (-1 to 1, where -1 = bottom edge, 0 = center, 1 = top edge)
|
|
299
303
|
// - scale: Scale factor (1.0 = original size, 2.0 = double size, 0.5 = half size)
|
|
@@ -398,14 +402,18 @@ avatarView.avatarController.onError = (error: Error) => {}
|
|
|
398
402
|
#### Avatar Transform Methods
|
|
399
403
|
|
|
400
404
|
```typescript
|
|
401
|
-
//
|
|
402
|
-
|
|
405
|
+
// Get or set avatar transform (position and scale in canvas)
|
|
406
|
+
// Get current transform
|
|
407
|
+
const currentTransform = avatarView.transform // { x: number, y: number, scale: number }
|
|
408
|
+
|
|
409
|
+
// Set transform
|
|
410
|
+
avatarView.transform = { x, y, scale }
|
|
403
411
|
// - x: Horizontal offset in normalized coordinates (-1 to 1, where -1 = left edge, 0 = center, 1 = right edge)
|
|
404
412
|
// - y: Vertical offset in normalized coordinates (-1 to 1, where -1 = bottom edge, 0 = center, 1 = top edge)
|
|
405
413
|
// - scale: Scale factor (1.0 = original size, 2.0 = double size, 0.5 = half size)
|
|
406
414
|
// Example:
|
|
407
|
-
avatarView.
|
|
408
|
-
avatarView.
|
|
415
|
+
avatarView.transform = { x: 0, y: 0, scale: 1.0 } // Center, original size
|
|
416
|
+
avatarView.transform = { x: 0.5, y: 0, scale: 2.0 } // Right half, double size
|
|
409
417
|
```
|
|
410
418
|
|
|
411
419
|
**Important Notes:**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { A as APP_CONFIG, e as errorToMessage, l as logEvent, a as logger } from "./index-
|
|
4
|
+
import { A as APP_CONFIG, e as errorToMessage, l as logEvent, a as logger } from "./index-DgkjYDp2.js";
|
|
5
5
|
class StreamingAudioPlayer {
|
|
6
6
|
constructor(options) {
|
|
7
7
|
__publicField(this, "audioContext", null);
|
|
@@ -61,5 +61,14 @@ export declare class AvatarView {
|
|
|
61
61
|
get isOpaque(): boolean;
|
|
62
62
|
set isOpaque(value: boolean);
|
|
63
63
|
setBackgroundImage(image: HTMLImageElement | string | null): void;
|
|
64
|
-
|
|
64
|
+
get transform(): {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
scale: number;
|
|
68
|
+
};
|
|
69
|
+
set transform(value: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
scale: number;
|
|
73
|
+
});
|
|
65
74
|
}
|
|
@@ -2977,7 +2977,7 @@ const _AnimationPlayer = class _AnimationPlayer {
|
|
|
2977
2977
|
if (this.streamingPlayer) {
|
|
2978
2978
|
return;
|
|
2979
2979
|
}
|
|
2980
|
-
const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-
|
|
2980
|
+
const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-eWy8xl8G.js");
|
|
2981
2981
|
this.streamingPlayer = new StreamingAudioPlayer({
|
|
2982
2982
|
sampleRate: APP_CONFIG.audio.sampleRate,
|
|
2983
2983
|
channelCount: 1,
|
|
@@ -4378,7 +4378,7 @@ class AvatarSDK {
|
|
|
4378
4378
|
}
|
|
4379
4379
|
__publicField(AvatarSDK, "_isInitialized", false);
|
|
4380
4380
|
__publicField(AvatarSDK, "_configuration", null);
|
|
4381
|
-
__publicField(AvatarSDK, "_version", "1.0.0-beta.
|
|
4381
|
+
__publicField(AvatarSDK, "_version", "1.0.0-beta.35");
|
|
4382
4382
|
__publicField(AvatarSDK, "_avatarCore", null);
|
|
4383
4383
|
__publicField(AvatarSDK, "_dynamicSdkConfig", null);
|
|
4384
4384
|
class EventEmitter {
|
|
@@ -8444,10 +8444,17 @@ class AvatarView {
|
|
|
8444
8444
|
img.src = imageUrl;
|
|
8445
8445
|
}
|
|
8446
8446
|
}
|
|
8447
|
-
|
|
8447
|
+
get transform() {
|
|
8448
8448
|
if (!this.renderSystem) {
|
|
8449
8449
|
throw new Error("Render system not initialized");
|
|
8450
8450
|
}
|
|
8451
|
+
return this.renderSystem.getTransform();
|
|
8452
|
+
}
|
|
8453
|
+
set transform(value) {
|
|
8454
|
+
if (!this.renderSystem) {
|
|
8455
|
+
throw new Error("Render system not initialized");
|
|
8456
|
+
}
|
|
8457
|
+
const { x, y, scale } = value;
|
|
8451
8458
|
logger.log(`[AvatarView] Setting transform: x=${x}, y=${y}, scale=${scale}`);
|
|
8452
8459
|
this.renderSystem.setTransform(x, y, scale);
|
|
8453
8460
|
if (this.isInitialized && this.renderSystem) {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED