2013-03-07 46 views
-6

我想在我的應用程序中創建吹蠟燭。所以,請有人指點我一些教程,並給我一些想法,我該怎麼做。我應該使用OpenGl嗎?比我指出的關於OpenGL的好教程。想創建一個吹蠟燭

+0

請仔細閱讀[常見問題](http://stackoverflow.com/faq#questions) – Krishnabhadra 2013-03-07 09:40:38

+1

檢查:HTTP ://stackoverflow.com/questions/4019388/simulating-a-candle-flame-in-objective-c 和這個:https://github.com/codeport/ios/tree/master/outsider/iPhoneSDK-tutorial 和這個:http://answers.unity3d.com/questions/34976/how-to-simulate-candle-light-on-iphone.html 基本上:閱讀常見問題,並嘗試谷歌有時 – 2013-03-07 09:44:36

回答

2

從烏爾Graphix公司團隊獲取吹燭的一些圖像,並使用此代碼來製作動畫

NSArray *imagesArray=[NSArray arrayWithObjects: 
              [UIImage imageNamed:@"blowingCandle1.jpg"], 
               [UIImage imageNamed:@"blowingCandle2.jpg"], 
               [UIImage imageNamed:@"blowingCandle3.jpg"], 
              [UIImage imageNamed:@"blowingCandle4.jpg"], 
          nil]; 
UIImageView *blowCandleImageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0,80, 240)]; 
blowCandleImageView.backgroundColor=[UIColor blackColor]; 
blowCandleImageView.animationImages=imagesArray; 
blowCandleImageView.animationDuration=1.0; 
blowCandleImageView.animationRepeatCount=0; 
[blowCandleImageView startAnimating]; 
[self.view addSubView:blowCandleImageView];  
相關問題