给cocos-2d的场景设置背景颜色
来源:互联网 发布:环形网络拓扑结构特点 编辑:程序博客网 时间:2024/05/17 00:19
-(void) directorDidReshapeProjection:(CCDirector*)director
{
if(director.runningScene == nil) {
// Add the first scene to the stack. The director will draw it immediately into the framebuffer. (Animation is started automatically when the view is displayed.)
// and add the scene to the stack. The director will run it when it automatically when the view is displayed.
[director runWithScene: [IntroLayer scene]];
}
}
@end
在AppDelegate.m对场景进行初始化时,导演类会跳转到场景→IntroLayer scene
这个场景是在IntroLayer里新建的类型为CCScene
+(CCScene *) scene
这个场景会一闪而过,这个文件的最下面有个onEnter的实例方法,会直接跳转到另一个场景→HelloWorldLayer scene
在HelloWorldLayer初始化时,init
-(id) init
{
// always call "super" init
// Apple recommends to re-assign "self" with the "super's" return value
if( (self=[superinitWithColor:(ccc4(255,0,0,150))])) {
......
}
return self;
}
这里的if( (self=[super initWithColor:(ccc4(255,0,0,150))])) {
......
会设置背景颜色!
- 给cocos-2d的场景设置背景颜色
- 给控件设置背景颜色
- 给对话框整个面板设置背景颜色的方法
- ios给view设置背景颜色的正确方式
- 给MFC对话框设置背景颜色
- 给mfc中按钮设置背景颜色
- 怎么给button设置背景颜色?【Android】
- 设置对话框的背景颜色
- 设置控件的背景颜色。
- 设置GtkEntry的背景颜色
- 设置uinavigationbar的背景颜色
- 设置tableViewCell的背景颜色
- 自定义背景颜色的设置
- UITableViewCell的背景颜色设置
- 设置Activity的背景颜色
- Myeclipse的背景颜色设置
- 设置progressbar的背景颜色
- 设置背景的颜色透明度
- iPhone开发之-ios系统中各种设置项的url链接
- Http/1.1 (RFC 2616)阅读笔记
- Xcode5 设定启动时默认方向
- CMake 使用
- linux 信号&信号处理
- 给cocos-2d的场景设置背景颜色
- 网络流:最大流,最小割 基本概念及算法
- 重温设计模式(三)——职责链模式(chain of responsibility)
- ospf与其他路由协议重分发的默认表现
- syslog(),closelog()与openlog()--日志操作函数
- ComputerArea
- 转载_src/hwif和src/drv的区别
- iPhone开发 UILocalNotification的使用
- 创建一个简单的wf