上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页

五种绘图模式和四种渲染模式

摘要: 绘图模式1.textured:完全显示所有模型的游戏贴图2.wireframe:只显示模型的网络线框3.tex-wire:完全显示所有模型的游戏贴图以及所有模型的网络线框4.reder paths:设置渲染模式提前或者延迟5.lightmao resolution:设置场景之上的栅格网渲染模式1.RGB:默认渲染模式,正常的游戏渲染颜色2.Alpha:阿尔法半透明渲染模式3.Overdraw:设置透明模式4.Mipmaps:设置理想的纹理尺寸 阅读全文
posted @ 2013-06-04 08:55 jack_yan 阅读(778) 评论(0) 推荐(0)

获取本地视频的时间-IOS

摘要: //获取本地视频的时间 NSFileManager *fm = [[NSFileManager alloc]init]; NSString *docs = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject]; NSString *videofolder = [docs stringByAppendingPathComponent:[NSString stringWithFormat:@"VideoFolder/%@",self.folderna 阅读全文
posted @ 2013-05-31 11:43 jack_yan 阅读(855) 评论(0) 推荐(0)

网路视频播放-ios

摘要: -(void)playMovie{ NSURL *urls = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.3dhr.gov.cn%@",[self.detailDic objectForKey:@"m_path"]]]; movie = [[MPMoviePlayerController alloc]initWithContentURL:urls]; movie.controlStyle = MPMovieControlStyleDefault; [movie prepare 阅读全文
posted @ 2013-05-31 09:48 jack_yan 阅读(170) 评论(0) 推荐(0)

本地视频播放-ios

摘要: // 视频播放-(void)playMovie{ self.navigationItem.rightBarButtonItem.enabled = YES; self.movieName = @"1305178253912757X4VMU00207002"; self.folderName = @"1-11"; //在VideoFolder文件夹下建立子文件夹 NSFileManager *fm = [[NSFileManager alloc]init]; NSString *docs = [NSSearchPathForDirectoriesInD.. 阅读全文
posted @ 2013-05-31 09:47 jack_yan 阅读(299) 评论(0) 推荐(0)

UILabel自适应高度和自动换行

摘要: //初始化label UILabel *label = [[UILabel alloc] init]; NSString *text = @"阿萨德j啊思考的卡洛斯抵抗力将萨克林顿将拉开始监督卡拉基斯克林顿j啊思考了监督卡时间考虑到j啊思考了登记卡收录机抵抗力。。。"; label.text = text; [label setNumberOfLines:0]; UIFont *font = [UIFont fontWithName:@"Arial" size:14]; //设置字体 label.font = font; CGSize c... 阅读全文
posted @ 2013-05-23 14:10 jack_yan 阅读(310) 评论(0) 推荐(0)

C++中的vector使用范例

摘要: C++中的vector使用范例一、概述vector是C++标准模板库中的部分内容,它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库。vector是一个容器,它能够存放各种类型的对象,简单地说,vector是一个能够存放任意类型的动态数组,可以动态改变大小。例如:// c语言风格int myHouse[100] ;// 采用vectorvector<int> vecMyHouse(100);当如上定义后,vecMyHouse就可以存放100个int型的数据了。1. 它可以像普通数组一样访问eg: vecMyHouse[50] = 1024;2. 你可以顺序地向容器中填充数 阅读全文
posted @ 2013-04-25 15:17 jack_yan 阅读(906) 评论(0) 推荐(0)

cocos2d-x 游戏重置方法

摘要: 方法一:srand(time(NULL));array->removeAllObjects();this->removeAllChildren();init();方法二: CCDirector::sharedDirector()->replaceScene(HelloWorld::scene());从本场景切换到本场景,但是不能在init()函数中。。 阅读全文
posted @ 2013-04-25 15:15 jack_yan 阅读(327) 评论(0) 推荐(0)

cocos2d-x 音乐与音效

摘要: include "HelloWorldScene.h" #include "SimpleAudioEngine.h" using namespace cocos2d; using namespace CocosDenshion; //根据不同平台使用预编译索引不同音频文件 #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #define EFFECT_FILE "effect2.ogg" #elif (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE) 阅读全文
posted @ 2013-04-25 15:14 jack_yan 阅读(431) 评论(0) 推荐(0)

cocos2d-x srand(time(NULL))重新设置一个随机种子

摘要: 重新设置一个随机种子。。。 如果没有srand((unsigned)time(NULL));运行以下程序,每次输出结果会都是一样的。。。。。 void test_rand(void) { unsigned long n; srand((unsigned)time(NULL)); for(int i = 0; i < 100; i++) { n = rand(); printf("%10d\n", n); } } 阅读全文
posted @ 2013-04-25 15:14 jack_yan 阅读(443) 评论(0) 推荐(0)

cocos2d-x 精灵(如子弹)的去除

摘要: 举例代码如下: //游戏子弹与怪物的碰撞检测,当发生碰撞时从游戏中去除相碰撞的子弹与怪物 //getEemyArray()为定义在PlayScene类中得到怪物数组的函数, 下面语句体在子弹类中Bullet 继承 CCSprite for(int i = 0; i < PlayScene::sharedPlay()->getEnemyArray()->count(); i ++) { Enemy* enemy = (Enemy*) PlayScene::sharedPlay()->getEnemyArray()->objectAtIndex(i); ... 阅读全文
posted @ 2013-04-25 15:13 jack_yan 阅读(1329) 评论(1) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页