@theatrejs/loader-ldtk
v2.2.0
Published
⚙️ A Webpack Loader for LDTK files.
Maintainers
Readme
LDTK Webpack Loader
⚙️ A Webpack Loader for LDTK files.
Installation
npm install @theatrejs/plugin-ldtk --savenpm install @theatrejs/loader-ldtk --save-devWebpack Configuration
{
'module': {
'rules': [
...
{
'test': /\.ldtk$/,
'use': [
{
'loader': '@theatrejs/loader-ldtk'
}
]
}
...
]
}
}Webpack Configuration (Advanced Options)
{
'module': {
'rules': [
...
{
'test': /\.ldtk$/,
'use': [
{
'loader': '@theatrejs/loader-ldtk',
'options': {
'constants': true // The option for generating the constants files with all the LDTK level and layer names.
}
}
]
}
...
]
}
}Quick Start
import ldtk from './game.ldtk';
import * as LAYERS_GAME from './layers.game.ldtk';
import * as LEVELS_GAME from './levels.game.ldtk';
const grid = ldtk.createGrid({
$level: LEVELS_GAME.PROTOTYPE,
$layer: LAYERS_GAME.ACTORS
});