gpt4 book ai didi

ios - Swift 中的 CGPointMake

转载 作者:IT王子 更新时间:2023-10-29 05:04:40 26 4
gpt4 key购买 nike

如何在Swift中使用CGPointMake?有没有等价物?我收到一个错误:

Use of unresolved identifier 'CGPointMake'

基本上,我正在尝试为 Sprite Kit 节点分配一个位置,但不知道如何在 Swift 中执行此操作。

class PlayerSpaceship: Spaceship {

func launchMissile() {

var missile = Missile.playerMissile()

// This line gives above mentioned error.
missile.position = CGPointMake(0.0, 0.0)
}
}

最佳答案

使用CGPoint(x: Float, y: Float)

关于ios - Swift 中的 CGPointMake,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24070408/

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