SOLVED Need idea how check sprites on layout

Get help using Construct 2

Post » Mon Aug 18, 2014 8:42 pm

I need condition something familiar to 'is on-screen' but i need to check sprites if sprite 'is on layout' do something?
Any ideas?
Last edited by delgado on Tue Aug 19, 2014 12:17 pm, edited 1 time in total.
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Mon Aug 18, 2014 8:49 pm

Have you tried using the "Is outside Layout" event and inverting it?
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Tue Aug 19, 2014 11:14 am

@FragFather yeah i try this at first place, dont work correctly
@Ashley is this condition is missing in C2?
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Tue Aug 19, 2014 11:35 am

No, the condition @FragFather suggested inverted should do exactly this. There are no known bugs with it, it should be working correctly.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Tue Aug 19, 2014 11:57 am

@Ashley now for me this is not working well, but maybe im wrong so correct me.
You do not have the required permissions to view the files attached to this post.
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Tue Aug 19, 2014 12:02 pm

@delgado - that project makes no sense. You are trying to use "Sprite is outside layout" to detect if all sprites have been destroyed. You should check if the sprite count is 0 instead. If no instances exist, none of its conditions are ever true (it makes no sense to ask if a sprite is inside/outside the layout if none exist - the question simply does not apply).
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Tue Aug 19, 2014 12:08 pm

@Ashley i know it makes no sens because im looking for solution how chceck spriteswhen are not on layout.
I makes this example because FragFather suggested.
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Tue Aug 19, 2014 12:12 pm

This works:
You do not have the required permissions to view the files attached to this post.
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 » Tue Aug 19, 2014 12:17 pm

@LittleStain YES
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Tue Aug 19, 2014 12:24 pm

But if you want to destroy the sprites like in your example and want to know if there aren't any left, you should check if sprite.count=0
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 How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests