Live2D Model Collection API
Live2D Model Collection API
Make your waifu come alive!
π’ Demo: Demo Website
π Preview: Models Preview
Description
This is a repository containing 2D anime character models that can be used on a website using JavaScript. The author has utilized several packages and libraries to facilitate the development process, ensuring that the models can be effectively used and function well on the website.
- Supports all versions of the live2d web rendering library
- Supports mouse interaction
- Added support for multiple models asynchronous loading + daily constant random model (changes to a random model from a custom list each day, does not refresh during the day)
- Support for out-of-range model detection and automatic resizing within the given range
- Mouse penetration/anti-blocking + eye-tracking support + model scaling API
- Dragging feature
What is Live2D?
Live2D is a technology that allows the creation of 2D models that can be animated interactively. This technology is commonly used in games, applications, and digital media to create lively characters.
Structure of a Live2D Model
A Live2D model consists of several main components:
- Model File (.moc3): Contains data for the model and animations.
- Texture (.png): The 2D image of the character to be animated.
- Parameter File (.json): Stores information about how the model interacts and animates.
How to use this?
Required Packages & Libraries:
1 | <script src="https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js"></script> |
And you can custom your model and positioning the model with native JavaScript:
1 | <script> |
Note: You can get the model API URL at this Preview Demo Website: Models Preview
Example
This is example of using Live2D Model:
1 | <script src="https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js"></script> |
| Parameter | Type | Default | Description |
|---|---|---|---|
| width | Optional[Number] | 800 | Width, in px |
| height | Optional[Number] | 600 | Height, in px |
| top, right, bottom, left | Optional[String] | bottom: '0px' | Distance of the model from browser edges. Use two to position (e.g., left: '0px', bottom: '0px' to position in the bottom left corner) |
| role | Reuired[String] | "" | Character model xxx.model.json file URL [model.zulma.id](https://github.com/AzharRizky/Live2D-Model) |
| background | Optional[String] | "" | Background image, can provide an external image link |
| opacity | Optional[Number] | 1 | Model opacity, value between (0,1) |
| mobile | Optional[Boolean] | false | Whether to display on mobile devices |
| scale | Optional[Number] | 0.1 | Model scale, value between (0,1) |
| draggable | Optional[Boolean] | false | Whether the model can be dragged |
| pierceThrough | Optional[Boolean] | true | Enable mouse penetration |
Structure Call
1 | Live2dLoader(config) |
Contribution
Want to make this project better? You can contribute this project, I am very open if there are contributions to this project. You can fork this repository and add your models to this directories /assets/models/[anime title/game title]/[here].

