我想获取我在 SKSpriteNode 上使用的图像的名称。
这就是我创建节点的方式:
SKSpriteNode *button = [SKSpriteNode spriteNodeWithImageNamed:@"img.png"];
通过触摸屏幕,我想在 NSLog 上获取此图像的名称。
UITouch *touch = [touches anyObject];
CGPoint loc = [touch locationInNode:self];
SKSpriteNode *node = (SKSpriteNode *)[self nodeAtPoint:loc];
通过触摸节点,我想获得有关此 SKSpriteNode 使用名为 img.png 的图像的 NSLog 信息。
我应该如何解决这个问题?
提前致谢。