Sprite containers and image points in families

Discussion and feedback on Construct 2

Post » Wed Dec 02, 2015 7:42 pm

I don't know if sprite containers and image points works in families but I'm not getting this. I'm using containers to spawn all sprites together and several image points to positioning these sprites in right places. Thanks in advance.
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Wed Dec 02, 2015 7:51 pm

Could you give an example of your capx/events?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 02, 2015 8:12 pm

Hi @LittleStain

Something like this (with more sprites)

https://www.dropbox.com/s/e1lwu0ai69hoz ... .capx?dl=0
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Wed Dec 02, 2015 8:33 pm

If you destroy all instances of sprite, sprite3, sprite4 and sprite5 on start of layout, it works better..
Although I'm not sure what you are trying to achieve..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 02, 2015 9:06 pm

I need the c2 spawns the small squares for all instances of sprite and positioning them in the right image points.
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Wed Dec 02, 2015 9:13 pm

Well your family contains both a Sprite5 and a Sprite, So setting sprite3 and sprite4 to family1 will set them to either Sprite5 or Sprite..

If you only want to set them to Sprite, use Sprite instead of family..
Or make sure ypu reference the right object..
Being in a container with Sprite automatically the right sprite3 and sprite4 are used when picking sprite..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Dec 02, 2015 9:16 pm

LittleStain wrote:Well your family contains both a Sprite5 and a Sprite, So setting sprite3 and sprite4 to family1 will set them to either Sprite5 or Sprite..

If you only want to set them to Sprite, use Sprite instead of family..


It was this way before, but I'll need to use a family to better control the sprites and their variables

Being in a container with Sprite automatically the right sprite3 and sprite4 are used when picking sprite..


Why it is not happening in the example that I done?
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Wed Dec 02, 2015 9:39 pm

Because you use family1 in the action and not Sprite, so if there is a Sprite5 and a Sprite object, Construct2 doesn't know which instance of family1 you mean..

Like I said, if you pick the Sprite-object, this will automatically reference the right Sprite3 and Sprite4, but you are not picking anything in your event..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Construct 2 General

Who is online

Users browsing this forum: HenryPK, newt, tarek2 and 8 guests