ios - SpriteKit SKCameraNode unable to animate zoom -
for ios game using spritekit. have camera node in scene.
var cam = skcameranode() self.camera = cam //this works, view zoomed out 2x cam.setscale(2) //i want animate zoom out, doesn't work let zoomoutaction = skaction.scaleto(2, duration: 1) cam.runaction(zoomoutaction)
i fixed it, added line: self.addchild(cam)
var cam = skcameranode() cam.position = cgpointmake(size.width/2, size.height/2) self.addchild(cam) self.camera = cam
Comments
Post a Comment