Recommended way to use properties

For developers using the Construct 2 Javascript SDK

Post » Wed Mar 11, 2015 4:37 pm

Hi.

I have created a property in my plugin, and I can see in the documentation that some of the properties can be accessed runtime in the this.properties[] array

But I am confused.

What is the preferred way to access the properties in the array?

If the script gets obfuscated will it not break if you use an index to access the array?

I could use an example..
B
5
Posts: 59
Reputation: 343

Post » Thu Mar 12, 2015 2:42 pm

Yea it breaks, it's really annoying and a terrible design.

from what i understand though, construct saves properties based on their name, so you can change the order without breaking future/past projects using an older version of your plugin, but you'll need to manually go into the run-time file to change all the references. So from a user perspective it's not big deal, but annoying for a developer to do the swapping.
B
53
S
7
G
6
Posts: 1,948
Reputation: 7,641

Post » Fri Mar 13, 2015 12:34 pm

Ok Thanks.

Is there a way you can access the properties of the plugin in the editor events?, or would you have to write getter and setter actions in the plugin?
B
5
Posts: 59
Reputation: 343

Post » Sun Mar 15, 2015 11:52 pm

@hgr

setters/getters using actions/expressions
B
53
S
7
G
6
Posts: 1,948
Reputation: 7,641


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest