Count all sprites

Get help using Construct 2

Post » Wed Oct 03, 2012 11:22 am

Is there a way to count all sprites on your layout?

I'm just wanting to keep track of all the sprites I have in comparison with the FPS
B
11
S
2
G
3
Posts: 95
Reputation: 3,028

Post » Wed Oct 03, 2012 2:55 pm

I don't have C2 licence so I can't tell you that it's posible to put your sprites in family and then set Text to "Family.Number.of.Object" like in CC - in CC that option you can call but it's not working like meany things in CC.

If that's not possible in C2 you can set text to 'objectcount'(from system) (all object that ara on layout and exclude those that are not sprite and counts as those that are on layot even if not visible. Some of these are:

text, particle, tilebackground,canvas, array, ok button, dictionary, fuction...

find out the rest that you use in your project and for total number of object substracte each of them

'objectcount'- number of object that are on layout (visible or not)and not sprites = number of sprites

that's all I can think ofpodpathos2012-10-03 14:58:10
B
12
S
2
G
2
Posts: 96
Reputation: 1,583

Post » Wed Oct 03, 2012 3:17 pm

All objects should be countable using the .count expression in both CC, and C2.
As in sprite.count, text.count, not sure but even family.count.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Oct 03, 2012 4:48 pm

if you wanna to count instances of "one sprite object" then it's possible, but if you wanna to count all sprite objects/not instances an their instances then it cant be done in one shoot. Family count dont work in CC. I sugest method in my first post if family count don't work in C2, or you get number of each sprite instance and add that to instance count of all other sprite objectspodpathos2012-10-03 16:54:20
B
12
S
2
G
2
Posts: 96
Reputation: 1,583

Post » Wed Oct 03, 2012 6:35 pm

Cool cheers all sounds good
B
11
S
2
G
3
Posts: 95
Reputation: 3,028


Return to How do I....?

Who is online

Users browsing this forum: jeffige, TheHat and 2 guests