Get object name

For questions about using Classic.

Post » Tue Jan 25, 2011 3:51 pm

Object name... Well, you can get OID and just use a string name as an alias for your convenience?

As for instance names, same thing with UID.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Jan 25, 2011 6:50 pm

The simplest way that I can think of would be to just use a hashtable, with no private variables.

Just setup the table like this for each object you want to get the name of:
[code:2ad5ng9p]+ System: Start of layout
-> HashTable: Insert key str(Sprite.OID) with value "Sprite"
-> HashTable: Insert key str(Sprite2.OID) with value "Sprite2"[/code:2ad5ng9p]

Then you can retrieve the name later with the OID of the object:
[code:2ad5ng9p]-> Text: Set text to HashTable (str(Sprite.OID))[/code:2ad5ng9p]
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Wed Jan 26, 2011 6:59 am

^ that is much better, yes. Basically you're using aliases for OID.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests