# easylive2d/live2dmascot architecture

> Architecture diagram of the GitHub repository easylive2d/live2dmascot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/easylive2d/live2dmascot
- Repository: https://github.com/easylive2d/live2dmascot

## Overview

This repository is a Python desktop Live2D mascot with interactive mouse input, model rendering, settings, and chat. The documented user flow is to launch the app, select/load a Cubism model, then interact with the on-screen mascot; the application also exposes tray controls and chat. The graph preserves the documented v2/v3 model support and chat capability. Some orchestration and UI wiring are represented only at enclosing-module level because their source was not sampled; uncertain call edges are omitted.

Main entry points: [`framework/runtime/drive/model/model_impl.py`](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/model/model_impl.py) (Model adapter), [`framework/runtime/core/input_manager.py`](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/input_manager.py) (Mouse input), [`framework/runtime/core/model/model_manager.py`](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/model/model_manager.py) (Model selection), [`framework/runtime/drive/setting_manager_impl.py`](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/setting_manager_impl.py) (System tray)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Runtime"]
  node_entry["Launch entry<br/>[main.py]"]
  node_application["Application lifecycle"]
  node_looper["Event looper<br/>[looper_impl_qt.py]"]
  node_scene["Mascot scene<br/>[scene.py]"]
end

subgraph group_interaction["Interaction and Chat"]
  node_input["Mouse input<br/>[input_manager.py]"]
  node_clickables["Clickable UI<br/>[clickable.py]"]
  node_chat["Chat behavior<br/>[kizuna_impl.py]"]
  node_chatcore["Chat domain<br/>[kizuna.py]"]
end

subgraph group_models["Model and Rendering"]
  node_modelmanager["Model selection<br/>[model_manager.py]"]
  node_modelimpl["Model adapter<br/>[model_impl.py]"]
  node_live2dv2["Cubism v2 engine<br/>[lapp_model.py]"]
  node_live2dv3["Cubism v3 engine<br/>[__init__.py]"]
  node_draw["Drawing manager"]
end

subgraph group_platform["Window and Settings"]
  node_window["Mascot window"]
  node_windowui["Window UI<br/>[window.py]"]
  node_settings["Settings manager<br/>[setting_manager.py]"]
  node_settingsui["Settings screens<br/>[settings.py]"]
  node_tray["System tray"]
end

node_user(("Desktop user"))
node_modelresources["Model resources"]

node_user -->|"launches"| node_entry
node_entry -->|"starts"| node_application
node_modelmanager -->|"creates model"| node_modelimpl
node_modelmanager -->|"changes scene model"| node_scene
node_modelimpl -->|"wraps v2"| node_live2dv2
node_modelimpl -->|"wraps v3"| node_live2dv3
node_modelresources -->|"model files"| node_modelmanager
node_input -->|"posts events"| node_looper
node_input -->|"dispatches input"| node_clickables
node_user -->|"mouse actions"| node_input
node_chatcore -->|"behavior implementation"| node_chat
node_draw -->|"renders scene"| node_scene
node_window -->|"provides window"| node_windowui
node_settings -->|"opens settings"| node_settingsui
node_tray -->|"handles tray options"| node_settings
node_tray -->|"posts setting action"| node_looper

click node_entry "https://github.com/easylive2d/live2dmascot/blob/python/main.py"
click node_application "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/application_impl.py"
click node_looper "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/looper/looper_impl_qt.py"
click node_scene "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/scene.py"
click node_input "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/input_manager.py"
click node_clickables "https://github.com/easylive2d/live2dmascot/blob/python/framework/ui/clickable.py"
click node_chat "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/kizuna/kizuna_impl.py"
click node_chatcore "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/kizuna/kizuna.py"
click node_modelmanager "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/model/model_manager.py"
click node_modelimpl "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/model/model_impl.py"
click node_live2dv2 "https://github.com/easylive2d/live2dmascot/blob/python/live2d/v2/lapp_model.py"
click node_live2dv3 "https://github.com/easylive2d/live2dmascot/blob/python/live2d/v3/__init__.py"
click node_draw "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/draw_manager_impl.py"
click node_window "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/window_manager_impl.py"
click node_windowui "https://github.com/easylive2d/live2dmascot/blob/python/framework/ui/window.py"
click node_settings "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/setting_manager.py"
click node_settingsui "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/window/settings/settings.py"
click node_tray "https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/setting_manager_impl.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_application,node_looper,node_scene,node_user toneBlue
class node_input,node_clickables,node_chat,node_chatcore toneAmber
class node_modelmanager,node_modelimpl,node_live2dv2,node_live2dv3,node_draw toneMint
class node_window,node_windowui,node_settings,node_settingsui,node_tray toneRose
class node_modelresources toneIndigo
```

## Components

### Application Runtime

- [Launch entry](https://github.com/easylive2d/live2dmascot/blob/python/main.py): `main.py`
- [Application lifecycle](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/application_impl.py): `framework/runtime/drive/application_impl.py`
- [Event looper](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/looper/looper_impl_qt.py): `framework/runtime/drive/looper/looper_impl_qt.py`
- [Mascot scene](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/scene.py): `framework/runtime/scene.py`

### Interaction and Chat

- [Mouse input](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/input_manager.py): `framework/runtime/core/input_manager.py`
- [Clickable UI](https://github.com/easylive2d/live2dmascot/blob/python/framework/ui/clickable.py): `framework/ui/clickable.py`
- [Chat behavior](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/kizuna/kizuna_impl.py): `framework/runtime/drive/kizuna/kizuna_impl.py`
- [Chat domain](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/kizuna/kizuna.py): `framework/runtime/core/kizuna/kizuna.py`

### Model and Rendering

- [Model selection](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/model/model_manager.py): `framework/runtime/core/model/model_manager.py`
- [Model adapter](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/model/model_impl.py): `framework/runtime/drive/model/model_impl.py`
- [Cubism v2 engine](https://github.com/easylive2d/live2dmascot/blob/python/live2d/v2/lapp_model.py): `live2d/v2/lapp_model.py`
- [Cubism v3 engine](https://github.com/easylive2d/live2dmascot/blob/python/live2d/v3/__init__.py): `live2d/v3/__init__.py`
- [Drawing manager](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/draw_manager_impl.py): `framework/runtime/drive/draw_manager_impl.py`

### Window and Settings

- [Mascot window](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/window_manager_impl.py): `framework/runtime/drive/window_manager_impl.py`
- [Window UI](https://github.com/easylive2d/live2dmascot/blob/python/framework/ui/window.py): `framework/ui/window.py`
- [Settings manager](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/core/setting_manager.py): `framework/runtime/core/setting_manager.py`
- [Settings screens](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/window/settings/settings.py): `framework/runtime/drive/window/settings/settings.py`
- [System tray](https://github.com/easylive2d/live2dmascot/blob/python/framework/runtime/drive/setting_manager_impl.py): `framework/runtime/drive/setting_manager_impl.py`

### Other components

- **Desktop user**
- **Model resources**

## Connections

- Desktop user → Launch entry: launches
- Launch entry → Application lifecycle: starts
- Model selection → Model adapter: creates model
- Model selection → Mascot scene: changes scene model
- Model adapter → Cubism v2 engine: wraps v2
- Model adapter → Cubism v3 engine: wraps v3
- Model resources → Model selection: model files
- Mouse input → Event looper: posts events
- Mouse input → Clickable UI: dispatches input
- Desktop user → Mouse input: mouse actions
- Chat domain → Chat behavior: behavior implementation
- Drawing manager → Mascot scene: renders scene
- Mascot window → Window UI: provides window
- Settings manager → Settings screens: opens settings
- System tray → Settings manager: handles tray options
- System tray → Event looper: posts setting action
