0 Favourites

How do I Work with Z-Order and Tilemap

  • I'm willing to create Z-order mechanic in order to create an ilusion of deph (Passing in front and behind regarding to object's Y and the player's Y). Actually I already did using sprites, but then the fps started to drop to 40 and now I'm back again to tilemaps fully, so I can almost guarantee a steady 60fps game. Are there any way to do it using tilemaps? I've already looked and there aren't an expression to get the tile's Y. So are there any other way to achieve it?

    Thanks.

  • I've already looked and there aren't an expression to get the tile's Y

    Did you look in the manual?

    Tile positions

    When using tiles in the object's conditions, actions and expressions, positions are generally given in tiles instead of layout co-ordinates. You can convert between tile positions and layout co-ordinates using the PositionToTileX/Y and TileToPositionX/Y expressions.

  • > I've already looked and there aren't an expression to get the tile's Y

    >

    Did you look in the manual?

    Tile positions

    When using tiles in the object's conditions, actions and expressions, positions are generally given in tiles instead of layout co-ordinates. You can convert between tile positions and layout co-ordinates using the PositionToTileX/Y and TileToPositionX/Y expressions.

    Yes, and the expression is TilemapSolids.TileToPositionY(TileY), in my case.

    But what about the "(TileY)"? This is exactly what I want to retrieve.

  • TilemapSolids.TileToPositionY(0) , will give you the y-position of the top row of tiles

    TilemapSolids.TileToPositionY(1) , will give you the y-position of the first row of the top.

    etcetera..

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • TilemapSolids.TileToPositionY(0) , will give you the y-position of the top row of tiles

    TilemapSolids.TileToPositionY(1) , will give you the y-position of the first row of the top.

    etcetera..

    Now I get it. Thank you very much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
4,517 857,509
Tinimations's avatar
Tinimations
Unread sticky
1,586 437,352
matriax's avatar
matriax
Unread hot topic
378 33,277
part12studios's avatar
part12studios