Minifier friendly plugins

For developers using the Construct 2 Javascript SDK

Post » Tue Feb 21, 2017 6:21 pm

Hi @Ashley
I've got some questions regarding your plugins:
- Why did you use jQuery instead of $ ?
- How do we prevent our plugins from breaking when a user minifies his project ?

Thanks
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Tue Feb 21, 2017 7:10 pm

- I think jQuery is clearer than $
- see docs
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Tue Feb 21, 2017 8:01 pm

Ashley wrote:- I think jQuery is clearer than $
- see docs


So basically when writing our own code we should access properties like so obj.position.x
But when dealing with libraries code, we should use brackets like so obj.['position'].['x'] ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Sat Feb 25, 2017 4:31 pm

@X3M

obj['position']['x']
B
108
S
26
G
266
Posts: 4,455
Reputation: 149,245


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest