好吧,我现在有这个问题.我在我的应用内购买中使用MKStoreKit.这是我的错误:
Failed transaction: <SKPaymentTransaction: 0x136a62e0>
error: Error Domain=SKErrorDomain Code=2 "Cannot connect to iTunes Store" UserInfo=0x13654a90 {NSLocalizedDescription=Cannot connect to iTunes Store}
Run Code Online (Sandbox Code Playgroud)
任何的想法?
我想在我的SpriteKit游戏上实现一个Textfield输入你的名字,所以我有这样的东西:
SKLabelNode* gameTitle = [SKLabelNode labelNodeWithFontNamed:@"Chalkduster"];
gameTitle.text = @"Game Title";
gameTitle.name = @"gametitle";
gameTitle.fontSize = 44.0;
gameTitle.fontColor = [SKColor blackColor];
gameTitle.position = CGPointMake(self.size.width/2,self.size.height/2 + 150);
[self addChild:gameTitle];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(self.size.width/2, self.size.height/2+20, 200, 40)];
textField.borderStyle = UITextBorderStyleRoundedRect;
textField.textColor = [UIColor blackColor];
textField.font = [UIFont systemFontOfSize:17.0];
textField.placeholder = @"Enter your name here";
textField.backgroundColor = [SKColor whiteColor];
textField.autocorrectionType = UITextAutocorrectionTypeYes;
textField.keyboardType = UIKeyboardTypeDefault;
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.delegate = self.delegate;
[self.view addSubview:textField];
Run Code Online (Sandbox Code Playgroud)
所以,问题是它没有在我的场景中显示,也许问题是当它添加到场景中时,我使用addSubview.
那是错的吗?
我正在SpriteKit中做一个声音切换按钮,我正试图找到一个快速的方法来做到这一点.我记得在Cocos2d中有一个叫做CCMenuItemToggle所有东西的变量,例如:
CCMenuItemToggle* musicButtonToggle = [CCMenuItemToggle
itemWithItems:[NSArray arrayWithObjects:soundButtonOn,soundButtonOff, nil]
block:^(id sender)
{
[self stopSounds];
}];
Run Code Online (Sandbox Code Playgroud)
有人知道在SpriteKit上做这个的方法吗?