1.0.1 • Published 5 months ago

@theatrejs/loader-ldtk v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Copyright License Bundle Size (Gzipped) NPM Version

LDTK Webpack Loader

⚙️ A Webpack Loader for LDTK files.

Installation

npm install @theatrejs/plugin-ldtk --save
npm install @theatrejs/loader-ldtk --save-dev

Webpack Configuration

{
    'module': {
        'rules': [
            ...
            {
                'test': /\.ldtk$/,
                'use': [
                    {
                        'loader': '@theatrejs/loader-ldtk'
                    }
                ]
            }
            ...
        ]
    }
}

Quick Start

import ldtk from './game.ldtk';

const entities = ldtk.getEntities({
    $level: 'Prototype',
    $layer: 'actors'
});

const grid = ldtk.getGrid({
    $level: 'Prototype',
    $layer: 'grid'
});