Page 1 of 1

R131 - Selecting family is not resulting the expec

PostPosted: Wed May 22, 2013 10:36 pm
by TELLES0808
Link to .capx file (required!):
https://dl.dropboxusercontent.com/u/47035927/temp/unexpected_result_selecting.capx

Steps to reproduce:
1. The code is designed to filter what sprite was selected in the family when you click over it;
2. The selected family object will be cloned to the mouse;

Observed result:
@Ashley, when selecting family is not resulting the expected Sprite object. Against it's giving a random family object.

Expected result:
Select the filtered sprite object;

Browsers affected:
Chrome: yes

Operating system & service pack:
Win 8 32 bits

Construct 2 version:
R131 - TELLES08082013-05-22 22:38:27

Re: R131 - Selecting family is not resulting the expec

PostPosted: Thu May 23, 2013 1:00 am
by Ashley
This is by design. If you pass a family to 'create object', it will pick a random member of the family and create that instead. You need to work around this by using e.g. an instance variable on each object that stores its type.

Re: R131 - Selecting family is not resulting the expec

PostPosted: Thu May 23, 2013 5:13 pm
by TELLES0808
So simple? Like giving an ID for each object and then creating the object with the same ID as the placed objects on the canvas?

I'm just worried about how to setup it to create the object by checking their ID, maybe after checking the family, and the IDs, create the object using their object sprites and not the family object instead.

Will try this today.

Thank you.

Solved =]
https://dl.dropboxusercontent.com/u/47035927/Samples/placement.capxTELLES08082013-05-23 22:55:55