Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
TiledMap: some questions - Gideros Forum

TiledMap: some questions

hnimhnim Member
edited January 2012 in General questions
Hi,
Im testing tmxmap samples, and i have some questions:
1. is tsx file supported?
2. when creating platform-games, maybe my player/enmies is bigger/smaller current tile'size. How can I set tile position exactly as i set on TiledMap?

Dislikes: Yan

+1 -1 (+0 / -1 ) Share on Facebook

Comments

  • atilimatilim Maintainer
    Hi,

    Only the Lua exporter of Tiled is supported. But previously (with version 0.7.0) the exported file was like:
    map = {...}
    But now (with version 0.7.1 and 0.8.0) the exported file is as:
    return {...}
    Therefore, I've updated the examples according to Tiled 0.8.0. You can download new examples here: http://dl.dropbox.com/u/684866/Tiled Map Editor.zip

    (I cannot understand your 2nd question)
  • Hi,
    in Tiled, we have option to add external tileset (*.tsx file). i tested but it didnt work.
    The 2sd, i create a layer with 32x32 tileset. Now, i want to add new 64x64 tileset. Map is loaded, but 64x64 tile's position is not exact as i want, example: i place a 64x64 tile on row 1 and col 1 ("32,32" on the map), when map is drawn, this tile is placed at "64,64"
  • atilimatilim Maintainer
    I understand now. Let me look at it.
  • Thanks,
    i think we should set tile position base on tilewidth and tileheight of map and/or adding setPosition method.
  • hi, i attached my project here :)
    map.png
    728 x 559 - 58K
    result.png
    675 x 559 - 13K
    zip
    zip
    TiledMapTest.zip
    51K
  • atilimatilim Maintainer
    Thank you. I was thinking about your question again and again and this sample code comes to rescue.
  • atilimatilim Maintainer
    edited January 2012
    I finally understand that current implementation cannot handle the case when tilemap and tileset have different sizes (16px vs. 32px). It will be available with the next release (February 7th).

    Thank you :)
  • that's great :).
    Just one more question :D: can i get individual region (TextureRegion) of tileset's texture through TileMap?
  • atilimatilim Maintainer
    You cannot do through TileMap, but can do with calculating the coordinates of the tile region. I would use a code like:
    local x = marginx + tx * (tilewidth + spacingx)
    local y = marginy + ty * (tileheight + spacingy)
    local textureRegion = TextureRegion.new(texture, x, y, tilewidth, tileheight)
    local bitmap = Bitmap.new(textureRegion)
    stage:addChild(bitmap)
    (I hope I understand you correctly)
  • yeah, that's way i'm doing. Thank you :)
  • atilimatilim Maintainer
    edited January 2012
    Hi hnim,

    I've extended the TileMap. Now tilemap and tileset can have different sizes. Thank you for catching this.

    tiled_screenshot.png
    490 x 406 - 27K
Sign In or Register to comment.