我试过这段代码它不起作用,我希望按钮在单击时播放声音。
-(void)starButtonsound:(id)sender
{
[[SimpleAudioEngine sharedEngine] playEffect:@"fire_truck_1.wav"];
}
在初始化
starMenuItemsound = [CCMenuItemImage
itemWithNormalImage:@"play.png" selectedImage:@"play.png"
target:self selector:@selector(starButtonsound:)];
starMenuItemsound.position = ccp(525, 500);
[self addChild:starMenuItemsound z: 4];
starMenuItemsound.scale = 0.75;
怎么了?