@doki-land/live2d 0.0.1 → 0.0.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/l2d.esm.js +31 -22
- package/dist/l2d.esm.js.map +1 -1
- package/dist/l2d.umd.js +1 -1
- package/dist/l2d.umd.js.map +1 -1
- package/lib/index.d.ts +7 -7
- package/package.json +1 -1
- package/readme.md +3 -0
- package/src/index.ts +25 -9
- package/src/types/Live2dOptions.ts +13 -2
package/dist/l2d.esm.js
CHANGED
|
@@ -31190,7 +31190,7 @@ eo.defaultMaxWidth = 2024, /** Default maxHeight, set at construction */
|
|
|
31190
31190
|
eo.defaultMaxHeight = 2024, /** Default autoResolution for all HTMLText objects */
|
|
31191
31191
|
eo.defaultAutoResolution = !0;
|
|
31192
31192
|
let Sm = eo;
|
|
31193
|
-
const
|
|
31193
|
+
const Cy = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ALPHA_MODES: jr, AbstractMultiResource: pu, AccessibilityManager: mu, AlphaFilter: zf, AnimatedSprite: Pa, Application: yu, ArrayResource: Of, Assets: Zn, AssetsClass: ud, Attribute: oo, BLEND_MODES: De, BUFFER_BITS: ga, BUFFER_TYPE: Li, BackgroundSystem: ho, BaseImageResource: rs, BasePrepare: Sa, BaseRenderTexture: jl, BaseTexture: Ge, BatchDrawCall: va, BatchGeometry: Hl, BatchRenderer: bs, BatchShaderGenerator: gf, BatchSystem: Yl, BatchTextureArray: xa, BitmapFont: as, BitmapFontData: vo, BitmapText: Em, BlobResource: bd, BlurFilter: Wf, BlurFilterPass: wa, Bounds: fo, BrowserAdapter: N0, Buffer: Pr, BufferResource: wo, BufferSystem: fu, CLEAR_MODES: Di, COLOR_MASK_BITS: O0, Cache: Ts, CanvasResource: Nf, Circle: To, Color: ir, ColorMatrixFilter: Ta, CompressedTextureResource: Cs, Container: ti, ContextSystem: lo, CountLimiter: Wd, CubeResource: Gf, DEG_TO_RAD: hf, DRAW_MODES: Ri, DisplacementFilter: Hf, DisplayObject: dr, ENV: Ms, Ellipse: Eo, EventBoundary: qf, EventSystem: Ea, ExtensionType: Kt, Extract: Md, FORMATS: qt, FORMATS_TO_COMPONENTS: wd, FXAAFilter: Yf, FederatedDisplayObject: Zf, FederatedEvent: An, FederatedMouseEvent: po, FederatedPointerEvent: pi, FederatedWheelEvent: js, FillStyle: $o, Filter: Gr, FilterState: yf, FilterSystem: Kl, Framebuffer: ba, FramebufferSystem: Jl, GC_MODES: Fa, GLFramebuffer: vf, GLProgram: Ef, GLTexture: oa, GRAPHICS_CURVES: zg, GenerateTextureSystem: nu, Geometry: ds, GeometrySystem: tu, Graphics: Au, GraphicsData: yo, GraphicsGeometry: kd, HTMLText: Sm, HTMLTextStyle: fa, IGLUniformData: s_, INSTALLED: ya, INTERNAL_FORMATS: Rr, INTERNAL_FORMAT_TO_BYTES_PER_PIXEL: go, ImageBitmapResource: Xs, ImageResource: ql, LINE_CAP: cs, LINE_JOIN: ni, LineStyle: Xa, LoaderParserPriority: xi, MASK_TYPES: Sr, MIPMAP_MODES: Bi, MSAA_QUALITY: vr, MaskData: bf, MaskSystem: eu, Matrix: ar, Mesh: gn, MeshBatchUvs: Bd, MeshGeometry: Mo, MeshMaterial: mn, MultisampleSystem: cu, NineSlicePlane: Zg, NoiseFilter: jf, ObjectRenderer: So, ObjectRendererSystem: du, ObservablePoint: Fi, PI_2: ao, PRECISION: ai, ParticleContainer: Jg, ParticleRenderer: wu, PlaneGeometry: Ud, PluginSystem: iu, Point: Ye, Polygon: Es, Prepare: Eu, Program: Ji, ProjectionSystem: su, Quad: mf, QuadUv: Ql, RAD_TO_DEG: af, RENDERER_TYPE: Nl, Rectangle: Ve, RenderTexture: Ds, RenderTexturePool: Zl, RenderTextureSystem: ou, Renderer: Ua, ResizePlugin: vu, Resource: _n, RopeGeometry: Gd, RoundedRectangle: Co, Runner: hi, SAMPLER_TYPES: ce, SCALE_MODES: Ki, SHAPES: Fr, SVGResource: Aa, ScissorSystem: Tf, Shader: ki, ShaderSystem: au, SimpleMesh: Qg, SimplePlane: Vd, SimpleRope: Kg, Sprite: _s, SpriteMaskFilter: xf, Spritesheet: Dl, StartupSystem: uo, State: Oi, StateSystem: Rf, StencilSystem: ru, SystemManager: If, TARGETS: Ws, TEXT_GRADIENT: Do, TYPES: Pe, TYPES_TO_BYTES_PER_COMPONENT: El, TYPES_TO_BYTES_PER_PIXEL: Td, TemporaryDisplayObject: gu, Text: Tu, TextFormat: io, TextMetrics: hs, TextStyle: ps, Texture: ne, TextureGCSystem: As, TextureMatrix: Oa, TextureSystem: hu, TextureUvs: Ba, Ticker: xr, TickerPlugin: Na, TilingSprite: Cu, TilingSpriteRenderer: Su, TimeLimiter: pm, Transform: bn, TransformFeedback: w_, TransformFeedbackSystem: lu, UPDATE_PRIORITY: is, UniformGroup: vi, VERSION: T_, VideoResource: _u, ViewSystem: co, ViewableBuffer: ma, WRAP_MODES: ts, XMLFormat: $a, XMLStringFormat: Ma, accessibleTarget: Qf, autoDetectFormat: Kd, autoDetectRenderer: kf, autoDetectResource: Wl, cacheTextureArray: cd, checkDataUrl: qs, checkExtension: gs, checkMaxIfStatementsInShader: nf, convertToList: gi, copySearchParams: Ca, createStringVariations: td, createTexture: wn, createUBOElements: Pf, curves: Ps, defaultFilterVertex: uu, defaultVertex: Bf, detectAvif: dd, detectCompressedTextures: xd, detectDefaults: _d, detectMp4: md, detectOgv: yd, detectWebm: gd, detectWebp: pd, extensions: be, filters: vl, generateProgram: Cf, generateUniformBufferSync: Mf, getFontFamilyName: sd, getTestContext: ff, getUBOData: $f, graphicsUtils: Yg, groupD8: gr, isMobile: Ii, isSingleItem: _o, loadBitmapFont: r2, loadDDS: Cd, loadImageBitmap: ad, loadJson: ed, loadKTX: Sd, loadSVG: hd, loadTextures: Po, loadTxt: rd, loadVideo: ld, loadWebFont: nd, parseDDS: Ad, parseKTX: Ed, resolveCompressedTextureUrl: Pd, resolveTextureUrl: vd, settings: fe, spritesheetAsset: Qd, uniformParsers: Ys, unsafeEvalSupported: _f, utils: Pp }, Symbol.toStringTag, { value: "Module" }));
|
|
31194
31194
|
var p0 = (
|
|
31195
31195
|
/** @class */
|
|
31196
31196
|
function() {
|
|
@@ -39804,35 +39804,44 @@ function by() {
|
|
|
39804
39804
|
var s;
|
|
39805
39805
|
(s = this.__moc) == null || s.release();
|
|
39806
39806
|
}
|
|
39807
|
-
async function
|
|
39807
|
+
async function Sy(s) {
|
|
39808
39808
|
const {
|
|
39809
|
-
|
|
39810
|
-
|
|
39811
|
-
|
|
39812
|
-
|
|
39813
|
-
|
|
39814
|
-
|
|
39815
|
-
|
|
39816
|
-
|
|
39817
|
-
|
|
39809
|
+
element_id: t = "live2d-canvas",
|
|
39810
|
+
models: r,
|
|
39811
|
+
width: i = 300,
|
|
39812
|
+
height: n = 300,
|
|
39813
|
+
auto_fit: o = !0,
|
|
39814
|
+
auto_motion: h = !0,
|
|
39815
|
+
mouse_tracking: c = !0
|
|
39816
|
+
} = s;
|
|
39817
|
+
let b = Ay(t);
|
|
39818
|
+
const T = new yu({
|
|
39819
|
+
view: b,
|
|
39820
|
+
width: i,
|
|
39821
|
+
height: n,
|
|
39822
|
+
// resolution: 1,
|
|
39818
39823
|
backgroundAlpha: 0,
|
|
39819
39824
|
autoDensity: !0,
|
|
39820
39825
|
antialias: !0
|
|
39821
|
-
}),
|
|
39822
|
-
if (
|
|
39823
|
-
const
|
|
39824
|
-
|
|
39826
|
+
}), C = await p2.from(r[0]);
|
|
39827
|
+
if (T.stage.addChild(C), o) {
|
|
39828
|
+
const x = Math.min(i / C.width, n / C.height);
|
|
39829
|
+
C.scale.set(x), C.x = (i - C.width * x) / 2, C.y = (n - C.height * x) / 2;
|
|
39825
39830
|
}
|
|
39826
|
-
return
|
|
39831
|
+
return c && wy(C, T.view), h && await Ty(C), C;
|
|
39827
39832
|
}
|
|
39828
|
-
function Ay(s
|
|
39833
|
+
function Ay(s) {
|
|
39834
|
+
let t = document.getElementById(s);
|
|
39835
|
+
return t || (t = document.createElement("canvas"), t.id = s, document.body.appendChild(t), t.style.display = "none", t.style.position = "fixed"), t;
|
|
39836
|
+
}
|
|
39837
|
+
function wy(s, t) {
|
|
39829
39838
|
document.addEventListener("mousemove", (r) => {
|
|
39830
39839
|
var b;
|
|
39831
39840
|
const i = t.getBoundingClientRect(), n = i.left + i.width / 2, o = i.top + i.height / 2, h = (r.clientX - n) / i.width, c = (r.clientY - o) / i.height;
|
|
39832
39841
|
s.internalModel && ((b = s.internalModel.focusController) == null || b.focus(h, c));
|
|
39833
39842
|
});
|
|
39834
39843
|
}
|
|
39835
|
-
async function
|
|
39844
|
+
async function Ty(s) {
|
|
39836
39845
|
var t;
|
|
39837
39846
|
try {
|
|
39838
39847
|
const r = (t = s.internalModel) == null ? void 0 : t.motionManager.definitions;
|
|
@@ -39849,15 +39858,15 @@ async function wy(s) {
|
|
|
39849
39858
|
console.warn("Failed to start idle animation:", r);
|
|
39850
39859
|
}
|
|
39851
39860
|
}
|
|
39852
|
-
async function
|
|
39861
|
+
async function Py(s, t) {
|
|
39853
39862
|
p2.registerTicker(xr), be.add(Na), be.add(Rm);
|
|
39854
39863
|
}
|
|
39855
39864
|
export {
|
|
39856
39865
|
p2 as Live2DModel,
|
|
39857
39866
|
Wa as MotionManager,
|
|
39858
|
-
|
|
39867
|
+
Cy as PIXI,
|
|
39859
39868
|
Dr as SoundManager,
|
|
39860
|
-
|
|
39861
|
-
|
|
39869
|
+
Sy as createLive2dModel,
|
|
39870
|
+
Py as initializeLive2D
|
|
39862
39871
|
};
|
|
39863
39872
|
//# sourceMappingURL=l2d.esm.js.map
|