内容简介:翻译自:https://stackoverflow.com/questions/506680/how-we-can-show-uiviewcontroller-and-uiview-by-using-cocos2d
我正在尝试使用Cocos2d构建一个iPhone应用程序.但我使用了四种类型的类
像吼叫 –
@interface MenuScene : Scene {} @end @interface FlipView : UIImageView { CGPoint startTouchPosition; NSString *dirString; UIImageView *firstPieceView; UIImageView *secondPieceView; } @end @interface HelloController : UIViewController @end @interface MenuLayer: Layer{ Todo *todo; Menu * menu; sqlite3 *database; NSMutableArray *todos; NSString *dirString; CGPoint startTouchPosition; } @property (nonatomic, retain) NSMutableArray *todos; -(void) button1: (id)sender; -(void) button2: (id)sender; -(void) black_jack: (id)sender; @end
但是如何通过MenuLayer类显示FlipView和HelloController类.
如果您正在询问如何将UIKit视图等附加到cocos2d-iphone项目,您只需要这样做:
[[[Director sharedDirector] window] addSubview:myView];
更新到cocos 0.7,现在这是:
[[[Director sharedDirector] openGLView] addSubview:myView];
在科科斯0.99:
[[[CCDirector sharedDirector] openGLView] addSubview:myView];
在Cocos 2.0中
[[[CCDirector sharedDirector] view] addSubview:myView];
翻译自:https://stackoverflow.com/questions/506680/how-we-can-show-uiviewcontroller-and-uiview-by-using-cocos2d
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 使用OpenGLES实现UIImageView显示效果
- 调查显示AI应用使用正在快速发展
- javascript – 使用jQuery显示/隐藏Checkbox
- 使用PHP显示Icecast2统计信息
- 为什么不能使用 Application Context 显示 Dialog?
- 调查显示:开发者比起 CD 更喜欢使用 CI
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
商业模式新生代
亚历山大•奥斯特瓦德 (Alexander Osterwalder)、伊夫•皮尼厄 (Yves Pigneur) / 王帅、毛心宇、严威 / 机械工业出版社 / 2011-8-15 / 88.00元
中文官网:http://www.bizmodel.org 内容简介:当你愉快的看完第一章:商业模式画布,赫然发现这些构成要素全 都交织成一幅清晰的图像在脑海中呈现,它们如何互相影响、如何交互作用全都历历在目。利用商业模式画布分析瑞士银行、Google、Lego、Wii 、Apple等跨国企业,归纳出三种不同的产业 模式,也涵括新近的热门现象免费效应及长尾理论等。在这些有趣的例子中,我们不仅更......一起来看看 《商业模式新生代》 这本书的介绍吧!