[swift] Scrolling Background 구현하기
스프라이트 키트를 사용해서 아래와 같이 하면 된다. import SpriteKit class GameScene: SKScene { // 전역 선언 let backRoad1 = SKSpriteNode (imageNamed: "grass_bg_02" ) let backRoad2 = SKSpriteNode (imageNamed: "grass_bg_02" ) let backFlower1 = SKSpriteNode (imageNamed: "grass_bg_03" ) let backFlower2 = SKSpriteNode (imageNamed: "grass_bg_03" ) var deltaRoad: CGFloat = 120.0 var deltaFlower: CGFloat = 20.0 override func didMoveToView(view: SKView ) { /* Setup your scene here */ // 배경 let imageField = UIImage (named: "grass_bg_01" ) let textureField = SKTexture (image: imageField!) let backField = SKSpriteNode (texture: textureField, size: self . frame . size ) backField. anchorPoint = CGPointZero backField. zPosition = - 3 self . addChild (backField) // 길 backRoad1 . anchor