... get Sprite Name?

Get help using Construct 2

Post » Fri Sep 07, 2012 3:13 am

I have a family with several sprites.
With a loop I'm saving to an array (when certain events ocurrs) every sprite (X,Y) coordinates. It works perfect, but I want to save in the same row the sprite name for debbuging.

I can't manage to find how to get the sprite name. How can I do that?

Thank you all :)
B
29
S
6
G
5
Posts: 148
Reputation: 5,084

Post » Fri Sep 07, 2012 3:43 am

1 workaround:
- Instance variable for the family called "name".
- To all family sprites, set individually the value of this variable with the sprite name.
- So, the instance var "name" is exposed with family.name.

... I can do this because my sprites are a finite number, but what if the wouldn't?... it has to exist a direct way to do this (?)

Well... my solution is enough for now.GamerGon2012-09-07 03:44:58
B
29
S
6
G
5
Posts: 148
Reputation: 5,084

Post » Fri Sep 07, 2012 1:00 pm

Allowing the name to be retrieved would make it slightly easier to reverse engineer projects. So your workaround is the best way to do it.
Scirra Founder
B
362
S
216
G
75
Posts: 23,119
Reputation: 180,502

Post » Fri Sep 07, 2012 4:39 pm

I understand.
Thank you @Ashley :)
B
29
S
6
G
5
Posts: 148
Reputation: 5,084


Return to How do I....?

Who is online

Users browsing this forum: Ratmaster, Zarocks and 5 guests