From 511bdab4ed5ae0ca5fd32bfa46edbb4260f49f39 Mon Sep 17 00:00:00 2001 From: Louis Pearson Date: Wed, 3 Aug 2022 13:09:45 -0600 Subject: [PATCH] Add readme --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c8657d8 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Zig LDtk + +This is a single file library for parsing LDtk JSON files. + +## Using + +Copy `LDtk.zig` into your project and use like so: + +```zig +const LDtk = @import("./LDtk.zig"); + +// ldtk_file should be a `[]const u8` of the file contents +const ldtk = LDtk.parse(allocator, ldtk_file); +defer ldtk.deinit(); + +// Now you can access your LDtk data through the `ldtk` struct +for (ldtk.levels) { + // ... +} +``` +Alternatively, add this repository as a git submodule.