objective c - SKSpriteNode showing up in iOS 8, not in iOS 7 -
i have skspritenode named ship, it's created :
ship = [skspritenode spritenodewithtexture:[sktexture texturewithimagenamed:@"spaceship"]]; ship.physicsbody = [skphysicsbody bodywithedgeloopfromrect:ship.frame]; ship.xscale = .5; ship.yscale = .5; ship.alpha = 1.0f; ship.position = cgpointmake(self.view.frame.size.width/2, self.view.frame.size.height/2); [self addchild:ship];
the ship shows fine on ios 8 simulator , on iphone 5 running ios 8, invisible on ios 7.
in update method set these logs :
nslog(@"ship : %@", ship); nslog(@"image : %@", ship.texture); nslog(@"alpha : %.2f", ship.alpha); nslog(@"parent : %@", ship.parent);
and output :
ship : <skspritenode> name:'(null)' texture:[<sktexture> 'spaceship' (100 x 100)] position:{160, 284} size:{25, 25} rotation:0.00 image : <sktexture> 'spaceship' (100 x 100) alpha : 1.00 parent : <skscene> name:'(null)' frame:{{0, 0}, {320, 568}}
everything there seems in order, , same log gets repeatedly called every update until ship, not visible @ all, flies off screen , code called remove , else.
without user interaction, on ios 8, happens ship appears in middle of screen, moves up, when exits frame game over. far can tell, exact same thing happening on ios 7, except ship invisible. frame's correct, responds user interaction, it's not showing up.
xcode 6 in beta right now. perchance issue. should seek running same code on xcode 5 ios 7 simulator or device.
also, can file bug study apple here.
ios objective-c sprite-kit xcode6
No comments:
Post a Comment