|
| 1 | +# Getting Started |
| 2 | + |
| 3 | +This guide will help you integrate Live2D-JavaBinding into your project. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. **Java 9 or higher**: The library uses JPMS (Java Platform Module System) and APIs introduced in Java 9. |
| 8 | +2. **OpenGL Context**: You need a library to create a window and an OpenGL context. We recommend **LWJGL 3**, but any library that provides access to OpenGL bindings will work. |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +Since this library is not hosted on a public Maven repository, you must download the latest release and install it manually. |
| 13 | + |
| 14 | +### 1. Download Release |
| 15 | +Go to the [GitHub Releases](../../releases) page and download: |
| 16 | +* `live2d-shared.jar` |
| 17 | +* `live2d-native-[platform].jar` (e.g., `live2d-native-windows-x64.jar`) |
| 18 | + |
| 19 | +### 2. Manual Installation |
| 20 | +You can install them into your local Maven repository: |
| 21 | + |
| 22 | +```bash |
| 23 | +mvn install:install-file -Dfile=live2d-shared.jar -DgroupId=com.example -DartifactId=live2d-shared -Dversion=1.0.0 -Dpackaging=jar |
| 24 | +mvn install:install-file -Dfile=live2d-native-windows-x64.jar -DgroupId=com.example -DartifactId=live2d-native -Dversion=1.0.0 -Dpackaging=jar -Dclassifier=windows-x64 |
| 25 | +``` |
| 26 | + |
| 27 | +### 3. Build Configuration |
| 28 | + |
| 29 | +#### Maven |
| 30 | +```xml |
| 31 | +<dependencies> |
| 32 | + <!-- The Core Java API --> |
| 33 | + <dependency> |
| 34 | + <groupId>com.example</groupId> |
| 35 | + <artifactId>live2d-shared</artifactId> |
| 36 | + <version>1.0.0</version> |
| 37 | + </dependency> |
| 38 | + |
| 39 | + <!-- Native Implementation --> |
| 40 | + <dependency> |
| 41 | + <groupId>com.example</groupId> |
| 42 | + <artifactId>live2d-native</artifactId> |
| 43 | + <version>1.0.0</version> |
| 44 | + <classifier>windows-x64</classifier> <!-- Change classifier as needed --> |
| 45 | + </dependency> |
| 46 | +</dependencies> |
| 47 | +``` |
| 48 | + |
| 49 | +#### Gradle |
| 50 | +For Gradle, the simplest way is to put the JARs directly into your project: |
| 51 | + |
| 52 | +1. Create a `libs` folder in your project root. |
| 53 | +2. Copy the downloaded JARs into it. |
| 54 | +3. Add dependencies in `build.gradle`: |
| 55 | + |
| 56 | +```groovy |
| 57 | +dependencies { |
| 58 | + implementation files('libs/live2d-shared.jar') |
| 59 | + implementation files('libs/live2d-native-windows-x64.jar') // Change for your platform |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +## Your First Steps |
| 64 | + |
| 65 | +The general flow of a Live2D application is: |
| 66 | + |
| 67 | +1. **Initialize**: Call `CubismFramework.startUp()`. |
| 68 | +2. **Load**: Load your model bytes and textures. |
| 69 | +3. **Loop**: In your render loop, call `model.update()` and `model.draw()`. |
| 70 | +4. **Dispose**: Clean up when done. |
| 71 | + |
| 72 | +Check out the specific sections in the sidebar to learn how to implement each step! |
0 commit comments