How to use CGPointMake
in Swift
? Is there an equivalent for it? I am getting an error:
Use of unresolved identifier 'CGPointMake'
Basically, I am trying to assign a position to a Sprite Kit node and cannot figure out how to do it in Swift.
class PlayerSpaceship: Spaceship {
func launchMissile() {
var missile = Missile.playerMissile()
// This line gives above mentioned error.
missile.position = CGPointMake(0.0, 0.0)
}
}
var p = CGPointMake(0, 0)
in Swift just fine. Is it possible that you just haven't included the CoreGraphics framework? – Multicolor(CGPoint){0.0,0.0}
– Abaftimport CoreGraphics
solved the issue. – LacasseCGPoint(x:0, y:0)
fix the problem without importing CoreGraphics or is there some other reason you accepted that answer? – Multicolor