praghus / tmx-map-parser Goto Github PK
View Code? Open in Web Editor NEWTiled Map Editor *.tmx files parser
License: MIT License
Tiled Map Editor *.tmx files parser
License: MIT License
I followed the README.md
and got this error
./node_modules/tmx-tiledmap/build/module/lib/tmx-parser.js Module not found: Can't resolve 'xml2js' in '/Users/xxx/Documents/project/node_modules/tmx-tiledmap/build/module/lib'
It seems that webpack failed to import tmx file.
I use react-app-rewired
to override webpack.config.js
, because my project was created by react-create-app
and I don't want to use the eject
command.
module.exports = {
webpack: function(config, env) {
const module = Object.assign({}, config.module || {});
const rules = module.rules || [];
rules.push(
{
test: /\.tmx$/,
include: path.join(process.cwd(), 'src/assets/map'),
use: 'url-loader'
}
);
module.rules = rules;
config.module = module;
return config;
}
}
Am I doing something wrong?
Thank you
This doesn't output any of the layers found in the groups.
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.2" tiledversion="1.3.1" orientation="orthogonal" renderorder="right-down" compressionlevel="-1" width="20" height="20" tilewidth="16" tileheight="16" infinite="0" nextlayerid="8" nextobjectid="2">
<tileset firstgid="1" name="tilemap_packed" tilewidth="16" tileheight="16" tilecount="486" columns="27">
<image source="../../../../../Downloads/kenney_rpgurbanpack/Tilemap/tilemap_packed.png" width="432" height="288"/>
<terraintypes>
<terrain name="Ocean" tile="198"/>
<terrain name="Grass" tile="198"/>
</terraintypes>
<tile id="0" terrain=",,,1"/>
<tile id="1" terrain=",,1,1"/>
<tile id="2" terrain=",,1,"/>
<tile id="5" terrain="1,1,1,"/>
<tile id="6" terrain="1,1,,1"/>
<tile id="27" terrain=",1,,1"/>
<tile id="28" terrain="1,1,1,1"/>
<tile id="29" terrain="1,,1,"/>
<tile id="32" terrain="1,,1,1"/>
<tile id="33" terrain=",1,1,1"/>
<tile id="54" terrain=",1,,"/>
<tile id="55" terrain="1,1,,"/>
<tile id="56" terrain="1,,,"/>
<tile id="170" terrain=",,,0"/>
<tile id="171" terrain=",,0,0"/>
<tile id="172" terrain=",,0,"/>
<tile id="175" terrain="0,0,0,"/>
<tile id="176" terrain="0,0,,0"/>
<tile id="197" terrain=",0,,0"/>
<tile id="198" terrain="0,0,0,0"/>
<tile id="199" terrain="0,,0,"/>
<tile id="202" terrain="0,,0,0"/>
<tile id="203" terrain=",0,0,0"/>
<tile id="224" terrain=",0,,"/>
<tile id="225" terrain="0,0,,"/>
<tile id="226" terrain="0,,,"/>
</tileset>
<group id="7" name="Ground">
<layer id="1" name="Background" width="20" height="20">
<data encoding="csv">
199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
199,176,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,177,199,199,
199,200,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,28,29,29,29,29,29,29,29,29,29,29,29,29,29,30,198,199,199,
199,200,55,56,56,56,56,56,56,56,56,56,56,56,56,56,57,198,199,199,
199,203,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,204,199,199,
199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,
199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199
</data>
</layer>
<layer id="5" name="Decorations" width="20" height="20">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,284,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<objectgroup id="2" name="Interactions">
<object id="1" name="Door" x="192" y="112" width="16" height="16"/>
</objectgroup>
</group>
<layer id="6" name="UI" width="20" height="20">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,90,91,91,92,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,144,145,145,146,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
</map>
After loading, would it be possible to make modifications, and save a new .tmx file?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.