1
我想在一個點來定位一個精靈:座標系中迅速IOS是錯誤的
class GameScene: SKScene {
let player = SKSpriteNode(imageNamed: "Koopa_walk_1.png")
override func didMove(to view: SKView) {
player.position = CGPoint(x: 0, y: 0)
self.addChild(player)
print(koopa.get_x())
}
}
但由於某些原因,我的精靈出現在屏幕的更多或更少的中間:
編輯:
這是原始圖像(由260px 320像素):
我期望看到的圖像顯示在左上角,因爲它的座標爲(0,0)
瞭解定位點 – Knight0fDragon
那麼你試圖在什麼位置放置東西?你的播放器的大小是多少?最重要的是,對於正確的立場,這個觀點的起源應該是什麼?你錯過了一些非常重要的事情來獲得幫助。 – dfd
https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Nodes/Nodes.html – matt