Helper Functions

For developers using the Construct 2 Javascript SDK

Post » Sat May 03, 2014 1:49 pm

I'd like to create helper functions in runtime.js that will have accessibility to variables I initialize in onCreate, without exposing these functions to the IDE.

How do I do that?
B
5
S
1
Posts: 28
Reputation: 431

Post » Sun May 04, 2014 12:51 pm

Make the helper functions member functions of the instance object. So attach them to instanceProto like the other functions and call them as this.helperFunction().
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Sun May 04, 2014 4:45 pm

Thanks :)
B
5
S
1
Posts: 28
Reputation: 431


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests