Iphone slide effect + background music
Today I got a few good-looking images, and I found out how to implement the slide effect of the images. This has also been achieved before. It's just a matter of time, in addition, the SoundEngine class is used to play background music. The SoundEngine class can be read from [url = read. php? Tid-1215.html] http://www.cocoachina.com/bbs/read.php? Tid-1215.html [/url] download.
The code is easy to post, so you only need:
-(Void) viewDidLoad
{
Array = [[NSMutableArray alloc] init];
Int I = 1;
For (I; I <= 30; I ++)
{
[Array addObject: [UIImageimageNamed: [NSString stringWithFormat: @ "d.jpg", I];
}
Pictures. animationImages = array;
Pictures. animationDuration = 300; // Time Interval
Pictures. animationRepeatCount = 0; // loop playback
[Pictures startAnimating]; // start playing
// Play background music using the SoundEngine class
SoundEngine_SetListenerPosition (0.0, 0.0, 1.0 );
SoundEngine_Initialize (44100 );
SoundEngine_LoadBackgroundMusicTrack ([[NSBundlemainBundle] pathForResource: @ "win" ofType: @ "caf"] UTF8String], true, true );
SoundEngine_StartBackgroundMusic ();
}
Playing in this way seems to occupy resources. It is difficult to compare and study other methods later.