• <small id='kwcHC'></small><noframes id='kwcHC'>

    <i id='kwcHC'><tr id='kwcHC'><dt id='kwcHC'><q id='kwcHC'><span id='kwcHC'><b id='kwcHC'><form id='kwcHC'><ins id='kwcHC'></ins><ul id='kwcHC'></ul><sub id='kwcHC'></sub></form><legend id='kwcHC'></legend><bdo id='kwcHC'><pre id='kwcHC'><center id='kwcHC'></center></pre></bdo></b><th id='kwcHC'></th></span></q></dt></tr></i><div id='kwcHC'><tfoot id='kwcHC'></tfoot><dl id='kwcHC'><fieldset id='kwcHC'></fieldset></dl></div>

    <tfoot id='kwcHC'></tfoot>
    • <bdo id='kwcHC'></bdo><ul id='kwcHC'></ul>

  • <legend id='kwcHC'><style id='kwcHC'><dir id='kwcHC'><q id='kwcHC'></q></dir></style></legend>

        电影播放时如何有菜单-iphone cocos2d

        时间:2024-08-12

        <legend id='p5Si2'><style id='p5Si2'><dir id='p5Si2'><q id='p5Si2'></q></dir></style></legend>

          1. <tfoot id='p5Si2'></tfoot>

            • <small id='p5Si2'></small><noframes id='p5Si2'>

                <tbody id='p5Si2'></tbody>
                  <bdo id='p5Si2'></bdo><ul id='p5Si2'></ul>
                  <i id='p5Si2'><tr id='p5Si2'><dt id='p5Si2'><q id='p5Si2'><span id='p5Si2'><b id='p5Si2'><form id='p5Si2'><ins id='p5Si2'></ins><ul id='p5Si2'></ul><sub id='p5Si2'></sub></form><legend id='p5Si2'></legend><bdo id='p5Si2'><pre id='p5Si2'><center id='p5Si2'></center></pre></bdo></b><th id='p5Si2'></th></span></q></dt></tr></i><div id='p5Si2'><tfoot id='p5Si2'></tfoot><dl id='p5Si2'><fieldset id='p5Si2'></fieldset></dl></div>
                • 本文介绍了电影播放时如何有菜单-iphone cocos2d的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用以下代码播放电影

                  I play a movie using the following code

                  NSString *path = [[NSBundle mainBundle] pathForResource:@"cobra" ofType:@"mp4"];
                  
                  theMovie=[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]];
                  theMovie.scalingMode=MPMovieScalingModeAspectFill;
                  // Add an observer to catch when playback ends
                  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(transition:) 
                                                               name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
                  // Start playback
                  theMovie.movieControlMode = MPMovieControlModeDefault;
                  [theMovie play];
                  

                  现在我想在正在播放的电影上有一个菜单.我的代码像

                  now i want to have a menu over the playing movie.I code like

                  MenuItemImage *item1 = [MenuItemImage itemFromNormalImage:@"Button_cobra.png" selectedImage:@"Button_cobra1.png" target:self selector:@selector (transition:)];
                  Menu *menu = [Menu menuWithItems:item1, nil];
                  menu.position = CGPointZero;
                  item1.position = ccp(330,260);
                  item1.scale = 0.5;
                  [self addChild:menu z:51];
                  NSLog(@"Leaving Layer2");
                  

                  但菜单没有显示.谁能告诉我怎么做.

                  But the menu is not getting displayed. Can anyone please tell me how to do it.

                  推荐答案

                  你必须等到窗口加载完毕,然后再做这样的事情.

                  You have to wait until the window is loaded and then do something like this.

                  NSArray *windows = [[UIApplication sharedApplication] windows];
                  if ([windows count] > 1)
                  {
                      // Locate the movie player window
                      UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
                      // Add our overlay view to the movie player's subviews so it is 
                      // displayed above it.
                      PlayerOverlayView *overlay = [[PlayerOverlayView alloc]initForPlayerWithButtonDelegate:self];
                      [moviePlayerWindow addSubview:overlay];
                      [overlay release];
                  }
                  

                  PlayerOverlayView 没什么特别的.只是我制作的 UIView 子类.我是从

                  PlayerOverlayView is nothing special. Just a UIView subclass i made. I call this from the

                  - (void) moviePreloadDidFinish:(NSNotification*)notification
                  

                  回调,效果很好.

                  这篇关于电影播放时如何有菜单-iphone cocos2d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:OpenGL vs Cocos2d:选择什么? 下一篇:何时使用 CCSpriteBatchNode?

                  相关文章

                  <tfoot id='Fb3TV'></tfoot>
                    <bdo id='Fb3TV'></bdo><ul id='Fb3TV'></ul>
                • <small id='Fb3TV'></small><noframes id='Fb3TV'>

                  <legend id='Fb3TV'><style id='Fb3TV'><dir id='Fb3TV'><q id='Fb3TV'></q></dir></style></legend>

                  <i id='Fb3TV'><tr id='Fb3TV'><dt id='Fb3TV'><q id='Fb3TV'><span id='Fb3TV'><b id='Fb3TV'><form id='Fb3TV'><ins id='Fb3TV'></ins><ul id='Fb3TV'></ul><sub id='Fb3TV'></sub></form><legend id='Fb3TV'></legend><bdo id='Fb3TV'><pre id='Fb3TV'><center id='Fb3TV'></center></pre></bdo></b><th id='Fb3TV'></th></span></q></dt></tr></i><div id='Fb3TV'><tfoot id='Fb3TV'></tfoot><dl id='Fb3TV'><fieldset id='Fb3TV'></fieldset></dl></div>