문서를 통해 SKTexture Ive의 크기를 설정하는 방법 Class Reference 크기를 설정할 수있는 것에 대해서는 아무 것도 보이지 않습니다. 나는 size 메소드가 return 메소드라는 것을 알고 있지만, 아래 코드에서 무엇을하려고하는지 명확하게 보여주고 있습니다. 이 마지막 애니메이션 이미지에 도달 대신 할 때 5 초 카운트 다운 후 나는 spriteNode의 크기를 변경할 수있는SKTexture의 크기 세트
_bomb = [SKSpriteNode spriteNodeWithImageNamed:@"Bomb5.gif"];
SKTexture *Bomb5 = [SKTexture textureWithImageNamed:@"Bomb5.gif"];
Bomb5.size = CGSizeMake(40, 40);
SKTexture *Bomb4 = [SKTexture textureWithImageNamed:@"Bomb4.gif"];
Bomb4.size = CGSizeMake(40, 40);
SKTexture *Bomb3 = [SKTexture textureWithImageNamed:@"Bomb3.gif"];
Bomb3.size = CGSizeMake(40, 40);
SKTexture *Bomb2 = [SKTexture textureWithImageNamed:@"Bomb2.gif"];
Bomb2.size = CGSizeMake(40, 40);
SKTexture *Bomb1 = [SKTexture textureWithImageNamed:@"Bomb1.gif"];
Bomb1.size = CGSizeMake(40, 40);
SKTexture *explostion = [SKTexture textureWithImageNamed:@"explosionnn.gif"];
explostion.size = CGSizeMake(90, 90);
//5 second countdown and the bomb explodes
countdown = [SKAction animateWithTextures:@[Bomb5,Bomb4, Bomb3, Bomb2, Bomb1, explostion] timePerFrame:1];
또 다른 방법? 어쩌면 내가 순서대로 작업을 추가 할 수 있습니다. 그러나 만약 내가 이렇게하면 폭탄이있는 곳의 중심에서 이미지의 크기를 어떻게 바꿀 수 있을까요?
나는 보일 수 없기 때문에 SKAction을 대체 할 수 있습니까? 저를 도울 함수를 찾으십시오. 카운트 다운이 끝났을 때 SpriteNode 스왑을 수행하는 방법을 몇 가지 코드로 알려주십시오. 고마워요 – 4GetFullOf
replaceAction에 내장 된 것이 없지만 기본적으로 사용할 수있는'performSelector : onTarget :'과'customActionWithDuration : actionBlock :'이 있습니다 ... –