guansss / pixi-live2d-display

A PixiJS plugin to display Live2D models of any kind.
https://guansss.github.io/pixi-live2d-display/
MIT License
870 stars 132 forks source link

usage without import syntax? #31

Closed niokasgami closed 3 years ago

niokasgami commented 3 years ago

Hi, I love your live2D integrations with pixijs! and I would love using it for my game dev!

the problem is that I use rpg maker MZ and they don't use an import / export syntax (which is a shame) I was wondering if there's way to include your library without the usage of imports?

Aka can I load it directly to the DOM with the usage of LoadScript? (the old way) this is how Rpg maker MZ load libraries. image

thank you and have a nice day!

guansss commented 3 years ago

Hi, I'm glad you like this library!

You can certainly load the library by using <script> elements, this is actually what the three demos do. When loading in this way, all the exported members can be accessed under PIXI.live2d namespace. Also make sure that the dependencies, PixiJS and Cubism Core, are loaded prior to this library.

I'm not familiar with rpg maker MZ and don't know if everything will work well in that environment, hopefully it will!

niokasgami commented 3 years ago

Hey guansss thanks for your quick answer! Rpg maker mz is just an engine built on top of PIXIjs to do more stuff (so a game framework with an editor)

if you tell me I can load via script then thank you for that!

guansss commented 3 years ago

OK I see.

Yes you can load via script. In case I didn't make it clear, the code you posted is a valid way to load this library.

guansss commented 3 years ago

Closing this due to the inactive state.