Get help using Construct 2

### » Sun Feb 23, 2014 8:23 am

Is this the kind of thing your looking for?
https://www.dropbox.com/s/r93yk7anwcwi3g3/tileinfo.capx
B
9
S
2
Posts: 68
Reputation: 768

### » Sun Feb 23, 2014 12:37 pm

w4rr3np34c3 wrote:So I'm starting to understand arrays a bit more but still feel like a complete noob, I tried setting some text every tick to "TileProperties.At(Mouse.X,Mouse.Y)" but I am assuming that it's the wrong way as it stays at a constant "0" I'm pretty much just going by trial and error at this point xD

Yeah that will most likely give you a 0

The reason for this is probably because there are no data stored at the given position.

As you move the mouse around, you constantly update where in the array you are reading data from. So if your layout is 1000x1000 pixels. And you move the mouse around you will look up data in the array based on pixels rather than tiles. This is because each tile in the tilemap is not 1x1 pixel big, but might be 32x32 or whatever you have chosen.

If we assume that each tile is 32x32, then the array at position (0,0) would actually be all pixels from 0-31, 0-31.

So what you have to do in order to get "TileProperties.At(Mouse.X,Mouse.Y)" to work, is to convert the mouse-position into a tile position. which is fairly easy, using the tilemap function PositionToTile(X,Y).

So your function should look like this:

TileProperties.At(Tilemap.PositionToTile(Mouse.X), Tilemap.PositionToTile(Mouse.Y))
B
45
S
12
G
3
Posts: 1,209
Reputation: 7,547

### » Tue Feb 25, 2014 2:22 pm

Thanks again guys lifesavers you are.
B
7
S
3
G
1
Posts: 18
Reputation: 1,111

### » Sun Jul 12, 2015 7:01 am

MiniHulk wrote:Is this the kind of thing your looking for?
https://www.dropbox.com/s/r93yk7anwcwi3g3/tileinfo.capx

B
75
S
25
G
11
Posts: 452
Reputation: 12,595

### » Sun Jul 12, 2015 4:02 pm

If you want the grid always there, you could add the grid outline to the tiles in the tilemap.

EDIT: Oops, didn't see how old the comment was that I was responding to...Sorry!
B
11
S
2
G
1
Posts: 79
Reputation: 842

Previous