Hi, I'm currently trying to get an objects position when you click on it. On my map, i have 1 object layer with about 7 objects on.
I'm currently getting the list of objects like this:
Code:
for (i = 0; i < map.getObjectCount(0); i++) {
for (j = 0; j < map.getObjectCount(0); j++) {
if (i == 0) {
System.out.println("i: " + i + " name: " + map.getObjectName(i, j));
}
}
}
The output for this is:
Code:
i: 0 name: TV
i: 0 name: Chair
i: 0 name: Sofa
i: 0 name: Picture
i: 0 name: Pot Plant
i: 0 name: Pot Plant
i: 0 name: Dining table and chairs
Which is entirely correct.
Now, the problem i'm getting is, how am i supposed to get the x and y of the objects and store them for use later? doing a similar loop for the getObjectX and getObjectY doesn't seem to be giving me anything.
Any help would be great! Thanks