untitled-pixi-live2d-engine 1.3.2 → 1.3.3
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/dist/cubism-legacy.es.js +22 -7
- package/dist/cubism-legacy.js +22 -7
- package/dist/cubism-legacy.min.js +1 -1
- package/dist/cubism.es.js +22 -7
- package/dist/cubism.js +22 -7
- package/dist/cubism.min.js +1 -1
- package/dist/index.es.js +22 -7
- package/dist/index.js +22 -7
- package/dist/index.min.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +8 -0
package/dist/index.es.js
CHANGED
|
@@ -105,7 +105,7 @@ const config = {
|
|
|
105
105
|
preserveExpressionOnMotion: true,
|
|
106
106
|
cubism: CubismFrameworkConfig
|
|
107
107
|
};
|
|
108
|
-
const VERSION = "1.3.
|
|
108
|
+
const VERSION = "1.3.3";
|
|
109
109
|
const logger = {
|
|
110
110
|
log(tag, ...messages) {
|
|
111
111
|
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
|
|
@@ -2954,6 +2954,7 @@ class Live2DModel extends Container {
|
|
|
2954
2954
|
* @param options - Options for Live2DModel and Automator.
|
|
2955
2955
|
*/
|
|
2956
2956
|
constructor(options) {
|
|
2957
|
+
var _a;
|
|
2957
2958
|
super();
|
|
2958
2959
|
/** @internal */
|
|
2959
2960
|
__publicField(this, "renderPipeId", "live2d");
|
|
@@ -2972,6 +2973,7 @@ class Live2DModel extends Container {
|
|
|
2972
2973
|
*/
|
|
2973
2974
|
__publicField(this, "textures", []);
|
|
2974
2975
|
__publicField(this, "textureOptions");
|
|
2976
|
+
__publicField(this, "anchorMode");
|
|
2975
2977
|
__publicField(this, "textureLODStates", []);
|
|
2976
2978
|
__publicField(this, "textureLODFailures", []);
|
|
2977
2979
|
/** @override
|
|
@@ -3088,6 +3090,7 @@ class Live2DModel extends Container {
|
|
|
3088
3090
|
}
|
|
3089
3091
|
});
|
|
3090
3092
|
this.textureOptions = options == null ? void 0 : options.textureOptions;
|
|
3093
|
+
this.anchorMode = (_a = options == null ? void 0 : options.anchorMode) != null ? _a : "canvas";
|
|
3091
3094
|
this.anchor = new ObservablePoint(
|
|
3092
3095
|
{
|
|
3093
3096
|
_onUpdate: () => this.onAnchorChange()
|
|
@@ -3216,7 +3219,9 @@ class Live2DModel extends Container {
|
|
|
3216
3219
|
}
|
|
3217
3220
|
this._boundsDirty = false;
|
|
3218
3221
|
this._didViewChangeTick++;
|
|
3219
|
-
this.
|
|
3222
|
+
if (this.anchorMode === "drawable") {
|
|
3223
|
+
this.onAnchorChange();
|
|
3224
|
+
}
|
|
3220
3225
|
}
|
|
3221
3226
|
generateUID() {
|
|
3222
3227
|
return ++this.currentGlId;
|
|
@@ -3283,6 +3288,9 @@ class Live2DModel extends Container {
|
|
|
3283
3288
|
initializeOnModelLoad(_options) {
|
|
3284
3289
|
this.tag = `Live2DModel(${this.internalModel.settings.name})`;
|
|
3285
3290
|
this.updateDrawableBounds();
|
|
3291
|
+
if (this.anchorMode === "canvas") {
|
|
3292
|
+
this.onAnchorChange();
|
|
3293
|
+
}
|
|
3286
3294
|
}
|
|
3287
3295
|
/**
|
|
3288
3296
|
* A callback that observes {@link anchor}, invoked when the anchor's values have been changed.
|
|
@@ -3292,11 +3300,18 @@ class Live2DModel extends Container {
|
|
|
3292
3300
|
if (!this.internalModel || !this.pivot) {
|
|
3293
3301
|
return;
|
|
3294
3302
|
}
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3303
|
+
if (this.anchorMode === "drawable") {
|
|
3304
|
+
const bounds = this.bounds;
|
|
3305
|
+
this.pivot.set(
|
|
3306
|
+
bounds.minX + this.anchor.x * bounds.width,
|
|
3307
|
+
bounds.minY + this.anchor.y * bounds.height
|
|
3308
|
+
);
|
|
3309
|
+
} else {
|
|
3310
|
+
this.pivot.set(
|
|
3311
|
+
this.anchor.x * this.internalModel.width,
|
|
3312
|
+
this.anchor.y * this.internalModel.height
|
|
3313
|
+
);
|
|
3314
|
+
}
|
|
3300
3315
|
}
|
|
3301
3316
|
/**
|
|
3302
3317
|
* Shorthand to start a motion.
|
package/dist/index.js
CHANGED
|
@@ -108,7 +108,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
108
108
|
preserveExpressionOnMotion: true,
|
|
109
109
|
cubism: CubismFrameworkConfig
|
|
110
110
|
};
|
|
111
|
-
const VERSION = "1.3.
|
|
111
|
+
const VERSION = "1.3.3";
|
|
112
112
|
const logger = {
|
|
113
113
|
log(tag, ...messages) {
|
|
114
114
|
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
|
|
@@ -2957,6 +2957,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2957
2957
|
* @param options - Options for Live2DModel and Automator.
|
|
2958
2958
|
*/
|
|
2959
2959
|
constructor(options) {
|
|
2960
|
+
var _a;
|
|
2960
2961
|
super();
|
|
2961
2962
|
/** @internal */
|
|
2962
2963
|
__publicField(this, "renderPipeId", "live2d");
|
|
@@ -2975,6 +2976,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2975
2976
|
*/
|
|
2976
2977
|
__publicField(this, "textures", []);
|
|
2977
2978
|
__publicField(this, "textureOptions");
|
|
2979
|
+
__publicField(this, "anchorMode");
|
|
2978
2980
|
__publicField(this, "textureLODStates", []);
|
|
2979
2981
|
__publicField(this, "textureLODFailures", []);
|
|
2980
2982
|
/** @override
|
|
@@ -3091,6 +3093,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3091
3093
|
}
|
|
3092
3094
|
});
|
|
3093
3095
|
this.textureOptions = options == null ? void 0 : options.textureOptions;
|
|
3096
|
+
this.anchorMode = (_a = options == null ? void 0 : options.anchorMode) != null ? _a : "canvas";
|
|
3094
3097
|
this.anchor = new pixi_js.ObservablePoint(
|
|
3095
3098
|
{
|
|
3096
3099
|
_onUpdate: () => this.onAnchorChange()
|
|
@@ -3219,7 +3222,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3219
3222
|
}
|
|
3220
3223
|
this._boundsDirty = false;
|
|
3221
3224
|
this._didViewChangeTick++;
|
|
3222
|
-
this.
|
|
3225
|
+
if (this.anchorMode === "drawable") {
|
|
3226
|
+
this.onAnchorChange();
|
|
3227
|
+
}
|
|
3223
3228
|
}
|
|
3224
3229
|
generateUID() {
|
|
3225
3230
|
return ++this.currentGlId;
|
|
@@ -3286,6 +3291,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3286
3291
|
initializeOnModelLoad(_options) {
|
|
3287
3292
|
this.tag = `Live2DModel(${this.internalModel.settings.name})`;
|
|
3288
3293
|
this.updateDrawableBounds();
|
|
3294
|
+
if (this.anchorMode === "canvas") {
|
|
3295
|
+
this.onAnchorChange();
|
|
3296
|
+
}
|
|
3289
3297
|
}
|
|
3290
3298
|
/**
|
|
3291
3299
|
* A callback that observes {@link anchor}, invoked when the anchor's values have been changed.
|
|
@@ -3295,11 +3303,18 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3295
3303
|
if (!this.internalModel || !this.pivot) {
|
|
3296
3304
|
return;
|
|
3297
3305
|
}
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3306
|
+
if (this.anchorMode === "drawable") {
|
|
3307
|
+
const bounds = this.bounds;
|
|
3308
|
+
this.pivot.set(
|
|
3309
|
+
bounds.minX + this.anchor.x * bounds.width,
|
|
3310
|
+
bounds.minY + this.anchor.y * bounds.height
|
|
3311
|
+
);
|
|
3312
|
+
} else {
|
|
3313
|
+
this.pivot.set(
|
|
3314
|
+
this.anchor.x * this.internalModel.width,
|
|
3315
|
+
this.anchor.y * this.internalModel.height
|
|
3316
|
+
);
|
|
3317
|
+
}
|
|
3303
3318
|
}
|
|
3304
3319
|
/**
|
|
3305
3320
|
* Shorthand to start a motion.
|