Pin objects together at design time/create "prefabs"?

Get help using Construct 2

Post » Mon Feb 24, 2014 5:46 am

What I'm looking for is the ability to group objects like sprites and text under a single parent - to create a Unity-style prefab or Flash-style movieclip that retains the relative positions of the objects it contains. Ideally the parent would then treat these child objects as properties and expose them to event scripting. Is there any way to pin objects together at design time this way? The closest things I've found are the pin behavior and the container property, but neither of those does quite what I need.

I scoured the forums and examples for awhile now looking for the answer, but based on what I could find this concept doesn't (yet) exist in Construct 2. Hopefully I'm wrong though - thanks!
B
42
S
14
G
2
Posts: 50
Reputation: 4,342

Post » Mon Feb 24, 2014 8:37 am

Pin behavior what you are looking for, even if you can't access directly the childls, but you can for example store the childs UID into some parent's variables and then access it easily.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Mon Feb 24, 2014 6:10 pm

Thank you Joskin, the UID idea is something I hadn't considered and sounds useful! I'll have to try that.

However it isn't really a replacement for the ability to piece objects together at design time in a prefab/template style. The ability to nest objects at design time to create composite objects is a very powerful feature that would benefit many Construct 2 users, but I have no idea how difficult it would be to implement on the dev side. It is probably quite a bit of work.

Still, if I can't find a way to do it soon, I'll head over to the general discussion and request it as a feature. Can't hurt to ask, right?
B
42
S
14
G
2
Posts: 50
Reputation: 4,342

Post » Mon Feb 24, 2014 6:18 pm

I asked for this ages ago. Not on the list of things to do as far as i know.
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

Post » Mon Feb 24, 2014 9:04 pm

Like spongehammer i asked for this a long time ago too, but Ashley said it wasn't needed because we can just then PIN. I even made a long post how Containers should optionally just use XY pinning by default with out the need of the Behaviour, but it's not going to happen.

It's crummy.

the easiest thing you can do. Is add all the parts of your container into a Family. Then select the root parent by whatever condition. Then select the Family by he same condition(ie give the Family a unique name) Then Pin the Family to the parent. The problem with this is that there is no mutual family where you can mix objects. families need to be of one type :(

I wold love a Family of multi type :)
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Mon Feb 24, 2014 9:07 pm

Well in theory you could do it with a plug.
That is essentially what Spriter does.
B
171
S
50
G
180
Posts: 8,396
Reputation: 113,986

Post » Thu Feb 27, 2014 12:00 am

Thanks for the responses! I figure the more people that request it the more likely it will be seriously considered, so I'll go ahead and put in a feature request too.
B
42
S
14
G
2
Posts: 50
Reputation: 4,342


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests