Tilemap Tiletoposition

Discussion and feedback on Construct 2

Post » Tue Feb 18, 2014 3:09 am

OK, so I was having problems getting an object to re-position to a Tilemap Tile. I added a text field and set an event to give me the Tilemap TileToPositionX(mouse.x) and same for Y. I have the tilemap bounding box centered on the screen. I also have the left click tell me the mouse.x and mouse.y when off the tilemap object.

Why when I click to the left of the tilemap object I get the correct Mouse.X (222) and Mouse.Y (170) BUT

When over the tilemap a few pixels to the right it gives me
TileToPositionX(mouse.x)= 7537 and 5566 for Y?

I do not understand the discrepancy...
B
193
S
6
G
7
Posts: 213
Reputation: 10,203

Post » Tue Feb 18, 2014 3:14 am

Here is the capX I used to show this...

https://app.box.com/s/i81gjuzlmgjdyozz9xbc
B
193
S
6
G
7
Posts: 213
Reputation: 10,203

Post » Tue Feb 18, 2014 2:16 pm

This looks like a bug and you should post this in Bug section.
For a little workaround you can set your text to
"Tilemap.TileToPositionX(Mouse.X) /32 & ":" & Tilemap.TileToPositiony(Mouse.Y) /32"

ImageImageImageImage
B
157
S
64
G
41
Posts: 2,590
Reputation: 34,640


Return to Construct 2 General

Who is online

Users browsing this forum: Cliffu, jakezinis and 4 guests