pytmx | Python library to read Tiled Map Editor 's TMX maps | Map library

 by   bitcraft Python Version: 3.25 License: LGPL-3.0

kandi X-RAY | pytmx Summary

kandi X-RAY | pytmx Summary

pytmx is a Python library typically used in Geo, Map applications. pytmx has no bugs, it has no vulnerabilities, it has build file available, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

If you have any problems or suggestions, please open an issue. If you find this useful, please consider making a donation to help support it

            kandi-support Support

              pytmx has a low active ecosystem.
              It has 277 star(s) with 63 fork(s). There are 22 watchers for this library.
              It had no major release in the last 12 months.
              There are 7 open issues and 88 have been closed. On average issues are closed in 346 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pytmx is 3.25

            kandi-Quality Quality

              pytmx has 0 bugs and 0 code smells.

            kandi-Security Security

              pytmx has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pytmx code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              pytmx is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              pytmx releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed pytmx and discovered the below as its top functions. This is intended to give you an instant insight into pytmx implemented functionality, and help decide if they suit your requirements.
            • Parse a tileset
            • Cast node and set attributes
            • Check if the property contains a duplicate property name
            • Set properties
            • Parse an xml node
            • Set the properties of this layer
            • Add a layer
            • Adds a tileset to the map
            • Build a list of rects from the tileset
            • Simplify all_points
            • Return the GID associated with the given tiled gid
            • Generate sprites
            • Iterate over tile tiles
            • Return an iterator over the data
            • Parse the TiledGroupLayer layer
            • Loads map from file
            • Get tile locations by gid
            • Parse a TiledObjectGroup
            • Parse an XML node
            • Draw the map
            • Run the window
            • Render map surface
            • Load an image from a file
            • Parse TileLayer element
            • Parse a Tile object into a TileObject
            • Key press handler
            Get all kandi verified functions for this library.

            pytmx Key Features

            No Key Features are available at this moment for pytmx.

            pytmx Examples and Code Snippets

            No Code Snippets are available at this moment for pytmx.

            Community Discussions


            Pygame : image.convert_alpha() won't work
            Asked 2021-Nov-01 at 15:57

            So, I'm making a prototype of game using Pygame, Pytmx, and PyScroll (I'm following "Graven" Turorial on youtube)

            This is my problem : I have a spritesheet (96x38 pixels), and I want to get only one image of it..



            Answered 2021-Nov-01 at 15:57


            Screen to staggered isometric grid algorithm
            Asked 2020-Oct-03 at 11:55

            I'm working with Kivy and Pytmx, I need to get Grid Tile from Map Coordinates for staggered map.


            My tile size is:



            Answered 2020-Oct-03 at 11:55
            def subregion(px, py, r_x, r_y):
            rx = int(r_x)
            ry = int(r_y)
            foo = px - py
            bar = px + py
            if foo < 0 and bar > 1:  # Top
                return [rx, ry]
            elif foo < 0 and bar < 1:  # Left
                if r_y > 0:
                    if py > 0.5:
                        return [rx - 1, ry + 1]
                    return [rx - 1, ry]
                    return None
            elif foo > 0 and bar > 1:  # Right
                if r_y > 0:
                    if py > 0.5:
                        return [rx, ry + 1]
                    return [rx, ry]
                    return None
            elif foo > 0 and bar < 1:  # Bottom
                if r_y < 0:
                    return [rx, ry]
                return [rx, ry + 1]



            Pygame TMX file not loading
            Asked 2020-Sep-02 at 11:56

            I have been working on a KidsCanCode project in pygame( and I've finished everything. Now I'm trying to create levels by loading two different tiled formats, but only one will load. Even if I try just loading 'level2.tmx', it won't work. Here is the code:





            (By the way, in, when it says to load tiled1.tmx, it should say level2.tmx.)

            The error is this:



            Answered 2020-Sep-01 at 09:26

            The error indicates that the file, level2.tmx, is compressed with compression type zstd. This kind of compression is not supported by your python install.

            If you install a python module to handle this kind of compression, such as the module at: It might work.

            Alternatively you need to convert level2.tmx to the same format as level1.tmx



            Handling tile objects using Pytmx
            Asked 2020-Jul-13 at 18:07

            so I am trying to build a side-scrolling platform game and have created a map using the Tiled Map Editor. I have succesfully loaded in non-tiled objects and tiles into my game using the following class I wrote:



            Answered 2020-Jul-13 at 18:07

            I found the solution by reading the Pytmx source code and trying things out. So this is code I use to read tile objects.



            How to select a random tmx map to be loaded? Opening a random file in pygame?
            Asked 2020-Jun-13 at 16:44

            Trying to select a random map from my maps folder when certain conditions are met, how would I go about selecting a new map.



            Answered 2020-Jun-13 at 16:44

            To get something random you need module random

            You can use choice() to get random item from list


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install pytmx

            You can download it from GitHub.
            You can use pytmx like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone bitcraft/pytmx

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link