⚙️ A Webpack Loader for LDTK files.
npm install @theatrejs/plugin-ldtk --savenpm install @theatrejs/loader-ldtk --save-dev{
'module': {
'rules': [
...
{
'test': /\.ldtk$/,
'use': [
{
'loader': '@theatrejs/loader-ldtk'
}
]
}
...
]
}
}{
'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.
}
}
]
}
...
]
}
}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
});