Assign multiple tags to sprite?

I have a sprite and i assign a tag to it to identify the number of that sprite, but i also want to assign one more tag which shows the category of sprite.

So when i click on sprite both the tags value is transferred to new scene for the further operation…

So is there a way to assign more than one tag or some different way to assign multiple values to a sprite…

You can set a tag and a name. A tag is an integer and a name is a string.

Additionally you can set user-data on the node. This is just a void pointer, so you can add anything you want: values, strings, structs, containers etc.

setTag(...)
setName(...)
setUserData(...)
1 Like

You could use bit masking to store your categories in the tag

The limit of using a bit mask is the bit size of an integer, typically 32. Therefore you can have a maximum of 32 bit flags within a single int.

1 Like

Thanks guys, got it done…