How do I Erase a Tile from a Tilemap with a Click?

Get help using Construct 2

Post » Sun Apr 05, 2015 3:57 pm

I been searching all over the Forums,Manual,Google and YouTube for this one simple answer.


How do I erase a tile from a tilemap when I am in game by clicking on it with the mouse?



"
PositionToTileX(x)
PositionToTileY(y)
Convert an X or Y layout co-ordinate in to the corresponding tile number in the tilemap. For example, this can be used to get the tile position under the mouse. "

Am I on the right track?
B
15
S
4
Posts: 88
Reputation: 1,827

Post » Sun Apr 05, 2015 4:22 pm

From 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.


Basically the tile you want is the x,y coordinate of that tile divided by the tile size.
Image
B
230
S
27
G
13
Posts: 1,776
Reputation: 18,153

Post » Sun Apr 05, 2015 4:23 pm

Yeah I figured it out. ty
B
15
S
4
Posts: 88
Reputation: 1,827


Return to How do I....?

Who is online

Users browsing this forum: RanTH, yenleidong and 26 guests