Runtime index of your object types?

For developers using the Construct 2 Javascript SDK

Post » Mon Apr 01, 2013 12:06 am

How do you figure out the runtime index of each of your object types, for use with runtime.types_by_index in the javascript?

Couldn't find anything about this in the manual or forums. Is there something in the editor that determines this?

B
5
S
1
Posts: 11
Reputation: 422

Post » Mon Apr 01, 2013 12:49 am

Types are assigned an index (accessible via type.index) in essentially an arbitrary sequence. It shouldn't be important what index a type gets. Also, don't rely on them being consistent between runs, because if the user deletes the type with index 0 in the editor they all shift down one... so every other type changes index!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Mon Apr 01, 2013 1:59 am

I figured that was the case, thanks!
B
5
S
1
Posts: 11
Reputation: 422


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests