gpt4 book ai didi

ios - 如何在 Swift 中创建一个空的 SKSpriteNode?

转载 作者:行者123 更新时间:2023-11-28 11:22:44 24 4
gpt4 key购买 nike

如何在 Swift 中创建一个空的 SKSpriteNode?我需要一个 SKSpriteNode 我可以添加 SKSpriteNode

children 。

Objective-C 中的等价物:

SKSpriteNode *textSprite = [SKSpriteNode new];

最佳答案

让类型推断完成确定类型的工作:

var textSprite = SKSpriteNode()

关于ios - 如何在 Swift 中创建一个空的 SKSpriteNode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25990546/

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