Code Monkey home page Code Monkey logo

zig-ldtk's Introduction

Zig LDtk

This is a single file library for parsing LDtk JSON files. Ldtk is a level editor for 2D games that allows you to organize many levels in one large world.

Built with zig 0.11.0

Usage

Copy LDtk.zig into your project, or add this repository as a git submodule.

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) {
    // ...
}

Features

  • Parse unseperated LDtk file
  • Parse seperated LDtk files
  • Load unseperated LDtk
  • Load seperated LDtk
  • Supported JSON Schema
    • 1. LDtk Json root
      • 1.1. World Generic
    • 2. Level
      • 2.1. Layer instance
      • 2.2. Tile instance Generic
      • 2.3. Entity instance
      • 2.4. Field instance
        • 2.4.2. Field instance entity reference Generic
        • 2.4.3. Field instance grid point Generic
    • 3. Definitions
      • 3.1. Layer definition
        • 3.1.1. Auto-layer rule definition
      • 3.2. Entity definition
        • 3.2.1. Field definition Generic
        • 3.2.2. Tileset rectangle Generic
      • 3.3. Tileset definition
      • 3.4. Enum definition
        • 3.4.1. Enum value definition

zig-ldtk's People

Contributors

desttinghim avatar p-louw avatar zkburke avatar

Stargazers

Benjamin Tucker avatar Johnathan Crocker avatar Austin Rude avatar Chris Heyes avatar Marcus Ramse avatar FlandreScarlet avatar Jacek Andrzejewski avatar max avatar Trevor Khaimia avatar  avatar Brad Svercl avatar Michal Ziulek avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

zkburke p-louw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.