# justy41/pixpart architecture

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

- Interactive diagram: https://gitdiagram.com/justy41/pixpart
- Repository: https://github.com/justy41/pixpart

## Overview

PixPart is a desktop pixel-art particle visualizer and generator. The user edits emitter settings in the UI; the live simulation advances particles, which are rendered with registered textures. The app also saves and loads emitter configurations as JSON and can simulate fixed-step frames for spritesheet export. The graph follows calls shown in Program.cs and sampled modules; README documents the product purpose and JSON workflow, while detailed behavior for some peripheral features is not inferred.

Main entry points: [`Program.cs`](https://github.com/justy41/pixpart/blob/main/Program.cs) (App loop), [`src/Core/Simulation.cs`](https://github.com/justy41/pixpart/blob/main/src/Core/Simulation.cs) (Simulation), [`src/Rendering/ParticleRenderer.cs`](https://github.com/justy41/pixpart/blob/main/src/Rendering/ParticleRenderer.cs) (Particle renderer), [`src/Export/JsonExporter.cs`](https://github.com/justy41/pixpart/blob/main/src/Export/JsonExporter.cs) (JSON config I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_program["App loop<br/>[Program.cs]"]
  node_editor["Emitter editor<br/>[Editorui.cs]"]
  node_file_dialog["File selection"]
end

subgraph group_simulation["Particle simulation"]
  node_config["Emitter settings<br/>[EmitterConfig.cs]"]
  node_simulation_core["Simulation<br/>[Simulation.cs]"]
  node_particle["Particle state<br/>[Particle.cs]"]
  node_pool["Particle pool<br/>[ParticlePool.cs]"]
  node_utils["Window bounds<br/>[Utils.cs]"]
end

subgraph group_visuals["Rendering and textures"]
  node_renderer["Particle renderer"]
  node_texture_library["Texture library<br/>[TextureLibrary.cs]"]
  node_offscreen["Offscreen capture"]
end

subgraph group_export["Export"]
  node_json["JSON config I/O<br/>[JsonExporter.cs]"]
  node_spritesheet["Spritesheet assembly"]
  node_json_file["JSON file"]
  node_image_file["Spritesheet image"]
end

node_user(("User"))

node_user -->|"edits settings"| node_editor
node_program -->|"draws UI"| node_editor
node_editor -->|"mutates"| node_config
node_program -->|"updates"| node_simulation_core
node_simulation_core -->|"reads settings"| node_config
node_simulation_core -->|"spawns and updates"| node_pool
node_pool -->|"stores"| node_particle
node_simulation_core -->|"checks bounds"| node_utils
node_program -->|"draws particles"| node_renderer
node_renderer -->|"gets textures"| node_texture_library
node_renderer -->|"renders state"| node_particle
node_program -->|"loads textures"| node_texture_library
node_program -->|"saves and loads"| node_json
node_json -->|"serializes config"| node_config
node_program -->|"selects file"| node_file_dialog
node_json -->|"reads and writes"| node_json_file
node_program -->|"captures frames"| node_offscreen
node_offscreen -->|"invokes draw"| node_renderer
node_program -->|"assembles frames"| node_spritesheet
node_spritesheet -->|"exports image"| node_image_file
node_user -.->|"runs app"| node_program

click node_program "https://github.com/justy41/pixpart/blob/main/Program.cs"
click node_editor "https://github.com/justy41/pixpart/blob/main/src/Editor/Editorui.cs"
click node_config "https://github.com/justy41/pixpart/blob/main/src/Core/EmitterConfig.cs"
click node_simulation_core "https://github.com/justy41/pixpart/blob/main/src/Core/Simulation.cs"
click node_particle "https://github.com/justy41/pixpart/blob/main/src/Core/Particle.cs"
click node_pool "https://github.com/justy41/pixpart/blob/main/src/Core/ParticlePool.cs"
click node_utils "https://github.com/justy41/pixpart/blob/main/src/Core/Utils.cs"
click node_renderer "https://github.com/justy41/pixpart/blob/main/src/Rendering/ParticleRenderer.cs"
click node_texture_library "https://github.com/justy41/pixpart/blob/main/src/Textures/TextureLibrary.cs"
click node_offscreen "https://github.com/justy41/pixpart/blob/main/src/Rendering/OffscreenRenderer.cs"
click node_json "https://github.com/justy41/pixpart/blob/main/src/Export/JsonExporter.cs"
click node_spritesheet "https://github.com/justy41/pixpart/blob/main/src/Export/SpritesheetExporter.cs"

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_program,node_editor,node_file_dialog,node_user toneBlue
class node_config,node_simulation_core,node_particle,node_pool,node_utils toneAmber
class node_renderer,node_texture_library,node_offscreen toneMint
class node_json,node_spritesheet,node_json_file,node_image_file toneRose
```

## Components

### Application

- [App loop](https://github.com/justy41/pixpart/blob/main/Program.cs): `Program.cs`
- [Emitter editor](https://github.com/justy41/pixpart/blob/main/src/Editor/Editorui.cs): `src/Editor/Editorui.cs`
- **File selection**

### Particle simulation

- [Emitter settings](https://github.com/justy41/pixpart/blob/main/src/Core/EmitterConfig.cs): `src/Core/EmitterConfig.cs`
- [Simulation](https://github.com/justy41/pixpart/blob/main/src/Core/Simulation.cs): `src/Core/Simulation.cs`
- [Particle state](https://github.com/justy41/pixpart/blob/main/src/Core/Particle.cs): `src/Core/Particle.cs`
- [Particle pool](https://github.com/justy41/pixpart/blob/main/src/Core/ParticlePool.cs): `src/Core/ParticlePool.cs`
- [Window bounds](https://github.com/justy41/pixpart/blob/main/src/Core/Utils.cs): `src/Core/Utils.cs`

### Rendering and textures

- [Particle renderer](https://github.com/justy41/pixpart/blob/main/src/Rendering/ParticleRenderer.cs): `src/Rendering/ParticleRenderer.cs`
- [Texture library](https://github.com/justy41/pixpart/blob/main/src/Textures/TextureLibrary.cs): `src/Textures/TextureLibrary.cs`
- [Offscreen capture](https://github.com/justy41/pixpart/blob/main/src/Rendering/OffscreenRenderer.cs): `src/Rendering/OffscreenRenderer.cs`

### Export

- [JSON config I/O](https://github.com/justy41/pixpart/blob/main/src/Export/JsonExporter.cs): `src/Export/JsonExporter.cs`
- [Spritesheet assembly](https://github.com/justy41/pixpart/blob/main/src/Export/SpritesheetExporter.cs): `src/Export/SpritesheetExporter.cs`
- **JSON file**
- **Spritesheet image**

### Other components

- **User**

## Connections

- User → Emitter editor: edits settings (evidence: `src/Editor/Editorui.cs`)
- App loop → Emitter editor: draws UI (evidence: `Program.cs`)
- Emitter editor → Emitter settings: mutates (evidence: `src/Editor/Editorui.cs`)
- App loop → Simulation: updates (evidence: `Program.cs`)
- Simulation → Emitter settings: reads settings (evidence: `src/Core/Simulation.cs`)
- Simulation → Particle pool: spawns and updates (evidence: `src/Core/Simulation.cs`)
- Particle pool → Particle state: stores (evidence: `src/Core/ParticlePool.cs`)
- Simulation → Window bounds: checks bounds (evidence: `src/Core/Simulation.cs`)
- App loop → Particle renderer: draws particles (evidence: `Program.cs`)
- Particle renderer → Texture library: gets textures (evidence: `src/Rendering/ParticleRenderer.cs`)
- Particle renderer → Particle state: renders state (evidence: `src/Rendering/ParticleRenderer.cs`)
- App loop → Texture library: loads textures (evidence: `Program.cs`)
- App loop → JSON config I/O: saves and loads (evidence: `Program.cs`)
- JSON config I/O → Emitter settings: serializes config (evidence: `src/Export/JsonExporter.cs`)
- App loop → File selection: selects file (evidence: `Program.cs`)
- JSON config I/O → JSON file: reads and writes (evidence: `src/Export/JsonExporter.cs`)
- App loop → Offscreen capture: captures frames (evidence: `Program.cs`)
- Offscreen capture → Particle renderer: invokes draw (evidence: `Program.cs`)
- App loop → Spritesheet assembly: assembles frames (evidence: `Program.cs`)
- Spritesheet assembly → Spritesheet image: exports image (evidence: `src/Export/SpritesheetExporter.cs`)
- User → App loop: runs app
