Layer vs Sprite

I’ve been using a Layer because I have a scene with bunch of sprites (> 50). At the same time a Sprite can handle children too. I’m having to use utils::getCascadeBoundingBox() to calculate layer size in a gesture handler and it’s adding stutter to the layer translation/scale operations. My question is that is it ok to use a sprite instead of layer?

I’m doing some tests now. I’ll be updating the thread with my results.

thx!

Hi.
It is ok to use sprites. In cocos older versions the Layer class handle touch inputs, Now we don’t need layers anymore. See this link:

1 Like

thanks @amin13a!

Agreed. Layer is not really needed anymore.

1 Like