get image point name by index

Discussion and feedback on Construct 2

Post » Tue Jan 14, 2014 8:38 am

Hi I have a sprite with about 20 image points and each has a specific name. I know which image point i want by index, is there any way to get the image point name given the index ?
Posts: 3
Reputation: 206

Post » Tue Jan 14, 2014 2:31 pm

No, but what do you need the name for if you know the index?
Scirra Founder
Posts: 25,207
Reputation: 200,355

Post » Tue Jan 14, 2014 7:15 pm

I have a large sprite with many image points on them, (about 40). Each image point has a name that tells me what the image is about. Another small sprite moves around it randomly an stops at a specific time. Then i loop through the image points using distance() to find the closest one. All this works well and I get the index to the image point but I have no way to get the image name.

I can work around it by storing all the names in an array and looking them up once I have the image point index.

It would be a useful to be able to get sprite1.imagepointname(loopindex) the same way we can get the sprite1.imagepointx(loopindex) as it would save keeping another array in sync with the image points.
Posts: 3
Reputation: 206

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests