gpt4 book ai didi

ios - SKLabelNode 从未出现在 TestFlight 中

转载 作者:行者123 更新时间:2023-11-29 12:17:30 26 4
gpt4 key购买 nike

在我的 Sprite Kit 游戏中,我使用了几个 SKLabelNodes ..在其中大多数我运行 SKActions。在各种 iOS 模拟器以及设备(iPhone 6)上一切正常。但! ..在所有 Testflight 设备(包括一些 iPhone 6)上,一个标签永远不会出现!

怎么可能呢?

最佳答案

我建议设置 SKLabelNode 的 .name 属性,以及场景中的所有其他节点,并使用一些日志语句进行测试:

(假设您使用:missingLabelNode.name = @"Missing";)

// make sure the Label Node has been added to the scene
NSLog(@"%@ label", [self childNodeWithName:@"Missing"].name);

确定后,日志打印“Missing Label”..

// Find the coordinates of the Label Node
NSLog(@"Located at X:%f Y:%f" [self childNodeWithName:@"Missing"].position.x, [self childNodeWithName:@"Missing"].position.y);

// If you've added it to a different layer of the scene, or another node
NSLog(@"Inside Parent:%@" [[self childNodeWithName:@"Missing"] parent].name);

您现在应该可以确定它在场景中的坐标和存在。如果它是场景本身以外的节点的子节点,您还可以转换它的位置,方法是使用 [self convertPoint:missingLabelNode.position toNode:self] 并记录这些坐标。

最后,如果您确定它应该在场景的视觉范围内,我会检查它的 zPosition。很容易在其他节点后面丢失一个节点。将 zPosition 属性增加到您设置的最高索引。如果您尚未设置任何其他节点的 zPosition,请使用 missingLabelNode.zPosition = 10.0f; 以将其置于节点层次结构的顶部。

这应该可以解决问题。

关于ios - SKLabelNode 从未出现在 TestFlight 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31638426/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com