Pass a plugin to a plugin

For developers using the Construct 2 Javascript SDK

Post » Sat May 03, 2014 3:05 pm

Is it possible to pass for instance a sprite plugin to a different plugin? and in the second plugin to freely control the frame of the sprite, etc...
B
5
S
1
Posts: 28
Reputation: 431

Post » Sat May 03, 2014 9:46 pm

Yes, it is possible, for example, official action move top.
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195

Post » Sun May 04, 2014 6:43 am

As in Z order -> Move to top? Because it doesn't seem to be that kind of action and I couldn't find any "move top" action.

Anyway, I did find some other actions:
Z Order -> Move to object
Misc -> Spawn another object

and there are probably more...

However I can't find these categories in plugins nor in behaviors. Do they appear under different folder names there or are they located elsewhere?
B
5
S
1
Posts: 28
Reputation: 431

Post » Sun May 04, 2014 9:00 am

@royibernthal

Yes, "Z order -> Move to top".
The source code is in file "commonace.js" , line 828 "acts.ZMoveToObject..."
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195

Post » Sun May 04, 2014 10:40 am

Where's the edittime file for that? The runtime as a matter of fact doesn't help me much, I'd like to see how to tell the IDE to pass a plugin to an action.
B
5
S
1
Posts: 28
Reputation: 431

Post » Sun May 04, 2014 12:40 pm

Just use the 'Object' parameter type. At runtime you're passed the object type for the chosen object.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464

Post » Sun May 04, 2014 4:29 pm

Sorry I completely missed the AddObjectParam function. Is it possible for me to limit the type of objects that can be passed?

Regardless, I successfully passed a sprite to my runtime function, how do I access its functions? (e.g. SetAnimFrame)
B
5
S
1
Posts: 28
Reputation: 431

Post » Mon May 05, 2014 2:48 am

You might reference this.
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests