Games [XUI2D] X2TileMap - Tiled maps

Discussion in 'Game Development' started by Erel, Jul 26, 2018.

  1. Erel

    Erel Administrator Staff Member Licensed User

    First version of X2TileMap is attached. It allows loading map files created with Tiled Map Editor:

    Tiled is a popular game editor. For now only the basic features are supported. X2TileMap can load maps with tile layers and draw them.
    Drawing is done automatically by calling DrawScreen or if you need more control you can call Draw and pass the required area.
    The performance is very good.


    - Maps and tilesets should be saved as json files. Note that you can edit json files directly with Tiled.
    - The data should be compressed and encoded as Base64 string. This is the default option.
    - Tilesets must be loaded from spritesheets (not collection of images).
    - It supports tile flipping and rotation, however the tiles images must be the same size as the map tiles.

    An example is attached. The video above is from the B4i example which shares the same code as the B4A and B4J examples.

    Example projects included in the examples pack:
    Last edited: Aug 23, 2018
    fredo, alwaysbusy, koaunglay and 16 others like this.
  2. Jeffrey Cameron

    Jeffrey Cameron Active Member Licensed User

    Well done!
    If you keep making this any easier and I just may have to revisit my shelved adventure game ;)
    Erel and Mark Turney like this.
  3. Don Oso

    Don Oso Active Member Licensed User

  4. Jeffrey Cameron

    Jeffrey Cameron Active Member Licensed User

    Have you done any testing to see how big (squares wide by high I mean) the maps can be (on average) before there starts to be memory or performance issues?
  5. Erel

    Erel Administrator Staff Member Licensed User

    The map size shouldn't really matter. X2TileMap only draws the currently visible tiles.

    In this specific example the minimap does draw the complete map. If the map is very large then it might be better to load it from a bitmap. However this is not the usual case.
    ocalle likes this.
  6. Erel

    Erel Administrator Staff Member Licensed User

    Examples were updated with latest version of X2 framework. Note that there is a file named objecttypes.json in the Files tab. This is a new file that is required when using X2TileMap. It holds the objects custom properties defaults. You can import it to Tiled with:
    View - Objects Type Editor
    File - Import
    fredo and Jeffrey Cameron like this.
  7. Erel

    Erel Administrator Staff Member Licensed User

    Updated the projects with the latest version of objecttypes.json, the file containing the default custom properties.
  8. Computersmith64

    Computersmith64 Well-Known Member Licensed User

    I don't understand how to use the x2 object type. I've created a new map (using a "roads" tileset that I have) & imported the x2 Object Type, but I can't figure out how to associate it with the map. When I look at the map that came with the example (map1.json) it shows an object layer (ObjectLayer1) with a sub-layer (x2) - but I can't seem to get that in my map.

    - Colin.
  9. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for your question (in the games forum).
    fredo and naifnas like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice