How do I Work with Z-Order and Tilemap

Get help using Construct 2

Post » Fri Jun 12, 2015 3:29 am

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.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Fri Jun 12, 2015 8:39 am

kossglobal wrote: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 told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jun 12, 2015 11:05 pm

LittleStain wrote:
kossglobal wrote: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.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Sat Jun 13, 2015 8:50 am

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jun 14, 2015 5:30 pm

LittleStain wrote: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.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612


Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 27 guests