setTag conflict between layers

I have doubt regarding “setTag”. For example, I created Layer_1 and Layer_2, in Scene and in this two layer have two sprites for each layer. and setTage number like (1) and (2).

  • cc.Scene
    ------- Layer_1
    ------------sprite1.setTag(1)
    ------------sprite2.setTag(2)
    ------- Layer_2
    ------------sprite1.setTag(1)
    ------------sprite2.setTag(2)

In this condition is there any conflict between layers, while deleting sprite based on the tag.

Yes. Tags are unique per scene . You can’t use the same tag more than once without removing the first one.

What is setTage()?

Thanks for replay.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.