As of now, I can only do:
`UIAlertView* dialog = [[UIAlertView alloc] init];
[dialog setDelegate:self];
[dialog setTitle:@"New Game"];
[dialog setMessage:@"Are you sure you want to start a new game? This will overwrite your current game."];
[dialog addButtonWithTitle:@"Yes"];
[dialog addButtonWithTitle:@"No"];
[dialog show];
[dialog release];
...
- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex==0) {
gametype = 1;
[[CCDirector sharedDirector] replaceScene:[CCTransitionCrossFade transitionWithDuration:1 scene:[GameScene node]]];
}
}
`
The bad thing is that the dialog box really does not mix in with the whole theme of the application.
Is there a way I can customize or create a dialogue box that appears?
I’ve heard that customizing UIAlertView has been very controversial to the point of being rejected form the app store. I don’t think I should go with this method. Do you have any suggestions/code I can use?
PS: I have a dialogue box image and yes/no buttons already done.
If you already have a dialog box and YES/NO buttons, then I would just add the dialog box the the layer a sprite with the YES/NO buttons overlaid as CCMenuItemImage(s). Then you can have the no button just hide the visibility of the menu and the dialog box and the yes button replace the scene.
Then in your noSelector method you can just hide the dialog box and in your yesSelector just replace the scene.