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
24
Posts: 388
Reputation: 14,494

Post » Tue Feb 21, 2017 7:10 pm

- I think jQuery is clearer than $
- see docs
Scirra Founder
B
402
S
238
G
89
Posts: 24,629
Reputation: 196,025

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
24
Posts: 388
Reputation: 14,494

Post » Sat Feb 25, 2017 4:31 pm

@X3M

obj['position']['x']
B
110
S
28
G
280
Posts: 4,487
Reputation: 156,566


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests