Giter Site home page Giter Site logo

anu-prakash-dev / ldtk-ts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jprochazk/ldtk-ts

0.0 0.0 0.0 1.33 MB

Parser for the LDtk project file format.

Home Page: https://www.jan-prochazka.eu/ldtk-ts

License: MIT License

JavaScript 2.65% TypeScript 97.35%

ldtk-ts's Introduction

ldtk-ts

LDtk file format type definitions and import wrapper.

This library provides an API without all the noise of LDtk "editor-only" values, definitions, etc., combined with many utilities to make usage easier.

If you just want the type definitions, they're fully compliant with the schema.

Documentation is available here.

$ npm install ldtk

Usage

Basic usage

import { World } from "ldtk";

World.loadRaw("assets/world.ldtk").then(async world => {
    // You have access to the raw `LDtk` JSON file here
    let currentLevel = world.levels[0];
    for (const layer of currentLevel.layerInstances) {
        console.log(layer);
        // the world is your oyster
    }
})

Using the importer

import { World, LDtk } from "ldtk";

World.fromURL("assets/world.ldtk").then(async world => {
    let currentLevel = world.levelMap["Level1"];
    function loop(time) {
        render(currentLevel);

        window.requestAnimationFrame(loop);
    }
    window.requestAnimationFrame(loop)
});

Versioning table

LDtk ldtk-ts
0.7.2 0.8.6
0.7.1 0.8.5
<0.7.0 not supported

ldtk-ts's People

Contributors

jprochazk avatar

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.