objective c - Calling SKSpriteNodes based on of their name -
in spritekit game have several sprites different name properties .
for (int = 0; < 10; i++) { skspritenode *sprite = [skspritenode spritenodewithimagenamed:@"png"]; sprite.name = [nsstring stringwithformat:@"name%i",i]; sprite.position = cgpointmake(100, 100); [self addchild:sprite]; }
is possible call 1 of these sprites based on name?
i found looking for.. use
[self childnodewithname:@"name"];
to search specific node.
Comments
Post a Comment