GithubHelp home page GithubHelp logo

praghus / tmx-map-parser Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 3.0 741 KB

Tiled Map Editor *.tmx files parser

License: MIT License

TypeScript 93.93% JavaScript 6.07%
tmx tmx-tiledmap parser tiled-map-editor tiled-parser

tmx-map-parser's People

Contributors

dependabot[bot] avatar praghus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tmx-map-parser's Issues

Can't resolve 'xml2js'

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

Handle groups

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>

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.