osu-beatmap-renderer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # osu-beatmap-renderer
2
+
3
+ osu! beatmap renderer for the browser (PixiJS). Parses `.osu` files and draws hit objects with hitsounds.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install osu-beatmap-renderer pixi.js
9
+ ```
10
+
11
+ `pixi.js` is a peer dependency (use v7 or newer).
12
+
13
+ ## Quick start
14
+
15
+ ```js
16
+ import { BeatmapEngine } from "osu-beatmap-renderer";
17
+
18
+ const engine = new BeatmapEngine(document.getElementById("renderer"));
19
+ await engine.init();
20
+ await engine.loadBeatmap({
21
+ osuUrl: "https://example.com/beatmap.osu",
22
+ audioUrl: "https://example.com/audio.mp3",
23
+ backgroundUrl: "https://example.com/bg.jpg",
24
+ });
25
+ engine.play();
26
+ ```
27
+
28
+ You can pass `osuText` instead of `osuUrl` if you already have the file as a string.
29
+
30
+ ## Build from source
31
+
32
+ ```bash
33
+ npm install
34
+ npm run build
35
+ ```
36
+
37
+ Built bundle: `dist/osu-beatmap-renderer.js`.
38
+
39
+ Run the demo page from a clone: `npm run dev` (uses `demo/` + `vite.demo.config.js`; not published to npm).